Home c block circuit for cycle

# block circuit for cycle

Author

Date

Category

In general, the university needs a block = schemes to draw to programmams from laboratory work. And I would have better made 3 times more than these laboratory works than painted this crap. And the most important story on the code does not care, the main unit of the scheme, and is increasing very hard.
Here is my code:

``````# include "stdafx.h"
#Include & lt; math.h & gt;
#include "FUNCSLIB.H"
INT MAIN ()
{
int x, a;
INT FUNC;
Double F;
test_dy g, y;
for (;) {
PrintF ("VVedite Nomer Zhelaemoi Funcii [1-3] ILI 0 dlya Vihoda:");
scanf_s ("% d", & amp; func);
if (FUNC == 0) BREAK;
Switch (FUNC) {
Case 1:
PrintF ("x =");
scanf_s ("% d", & amp x);
PrintF ("A =");
scanf_s ("% d", & amp; a);
G = FUNCG (X, A);
if (G.Valid)
PrintF ("G =% LF \ N", G.NUM);
ELSE.
Printf ("Vhodnye Znachenija Ne Prinadlezhat Oblasti Opredelenija Funkcii. \ n");
Break;
Case 2:
PrintF ("x =");
scanf_s ("% d", & amp x);
PrintF ("A =");
scanf_s ("% d", & amp; a);
F = FUNCF (X, A);
printf ("f =% lf \ n", f);
Break;
Case 3:
PrintF ("x =");
scanf_s ("% d", & amp x);
PrintF ("A =");
scanf_s ("% d", & amp; a);
Y = FUNCY (X, A);
if (y.valid)
PrintF ("y =% lf \ n", y.num);
ELSE.
Printf ("Vhodnye Znachenija Ne Prinadlezhat Oblasti Opredelenija Funkcii. \ n");
Break;
Default:
PrintF ("VI Dolzhni vvesti CIFRU OT 1 DO 3. \ n");
Break;
}
}
Return 0;
}
``````

Here is a flowchart that turned out:

He rejected ((what he needs – xs, can not explain. Help, please tell me, what’s wrong?

I would personally have rejected this block diagram. In the code there is a cycle, and in the diagram – no. But if you look greatly, it can be seen. But very cunning.

Secondly – according to the scheme, nothing is clear. I would say “rearranged with the callouts.” And the fact that 5 is associated with the beginning, it is full of horror. Would 1 (well, or on the extreme case of zero) – it would be clear.

But the flow charts sometimes make it useful. Understand the code structure. But the truth is not for any code so come to do it.

Necross.

1. Draw what functions FUNCF, FUNCG, FUNCY, or draw them in the “Predefined Process” block.
2. in the “key” in Default you have a display of paper? Vryatli. Use the “Display”.
3. Algorithm should not be dependent on the programming language. G.NUM, etc. – Remove.
4. Better to work “Connector”.
5. where data is input, then there is not the right block. Use the “manual input”.

is a quick inspection.

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.