Flow diagram of the cycle. Theory
I go through testing at a distance in cycles, according to the condition of the task, I have to write a utility with only the flowchart given below:
The third and fifth blocks are called the upper and lower bounds of the condition. Also, the course provides a description of this flowchart. But it also confuses me:
But if this flowchart means the "if" condition, then "if" has its own notation, just like for "while", "do while", and others. I fail all the questions that are related to this flowchart. Thank you for your answer, Amateur. Akina, even if I implement the simplest Loop in C# type:
static int SumDoWhile()
{
//
// Sum numbers 0 .. 4
//
int sum = 0;
int i = 0;
do
{
sum += i;
i++;
} while (i < 5);
return sum;
}
Then the flowchart to it will look like:
Cassini, do I understand you correctly that the drawing of the very first flowchart can be described as follows:
public delegate void TopMessage(string message);
class Program
{
static void Main(string[] args)
{
int a = 0;
int b = 1;
do
{
b = b + a;
a++;
}
while (a < 5);
Console.WriteLine(a);
Console.ReadLine();
}
1 answers
These are really quite ordinary loops with a precondition (while) or a postcondition (do .. while). Perhaps the reason to turn to the authors of the course.
Multiple sources: