I pass testing at a distance in cycles, according to the condition of the problem, I have to write a utility having only the block diagram below in my hands:
The third and fifth blocks are called the upper and lower bounds of the condition. Also, the course provides a description of this block diagram. But she also confuses me:
But if this block diagram means an “if” condition, then “if” has its own notation, just like “while”, “do while” and others. I am failing all the questions that are related to this flowchart.
Thanks for the answer, Lover.
Akina, even if I implement the simplest Loop in C # like:
static int SumDoWhile ()
{
//
// Sum numbers 0 .. 4
//
int sum = 0;
int i = 0;
do
{
sum + = i;
i ++;
} while (i & lt; 5);
return sum;
}
Then the block diagram for 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 & lt; 5);
Console.WriteLine (a);
Console.ReadLine ();
}
Answer 1, authority 100%
These are really quite ordinary loops with a precondition (while) or postcondition (do .. while). Perhaps the reason to contact the authors of the course.
Multiple sources: