What does a flowchart with a function call inside a condition look like?

How do I display a code snippet if (d<1 || d>amountofdays(m)) written in C in a flowchart?

Author: Jens, 2017-10-26

2 answers

Depends on the required level of detail of the algorithm.

If the function amountofdays is considered elementary, then it will be a single "Solution" block (rhombus), where you should write this: d<1 || d>amountofdays(m).

If you need to emphasize the call amountofdays as a subroutine, then you will have to disclose all the language constructs. There will first be a "Solution" block for the condition d<1, then a "Predefined Process" block for calling d0 := amountofdays(m) , and finally another "Solution" block with a check d>d0.

PS but, generally speaking, The flowchart is currently the stupidest of the code documentation options. Because of the very level of detail that consistently turns out to be lower than that of the code itself. If this is not a training task, then it is better to look for other ways of visualization (for example, UML or some IDEF).

 0
Author: Pavel Mayorov, 2017-10-26 11:41:42

Yes, as in any other language.

Rhombus, inside it you write the condition damountofdays(m). From the Rhombus there are 2 lines on both sides. Over the first line you write true, over the second false. Well, depending on which answer returns, the next one is already either a rhombus-if the condition goes further, or a square - if any commands are executed.

 0
Author: EVG, 2017-10-26 11:33:11