Ask your own question, for FREE!
Computer Science 14 Online
OpenStudy (anonymous):

how to Create a flowchart that represents the set of instructions provided: 1. Get two values from the user and store as x and y. 2. Multiply x by 2. 3. Repeat step number 2 y times. 4. Display the result of the operation

OpenStudy (e.mccormick):

Well, how far did you get? You will need to have some sort of evaluation that does a loop. |dw:1381530235796:dw|

OpenStudy (anonymous):

thank you @e.mccormick :D

OpenStudy (anonymous):

@e.mccormick are you sure this flowchart is loop??

OpenStudy (e.mccormick):

That is not a full flowchart. It is more like an outline of one thing that would be needed. Because you get both x and y from the user, you need to deal with the doing things y times. That is some sort of loop or recursion.

OpenStudy (anonymous):

what question that can i ask in the decision ..

OpenStudy (e.mccormick):

If you got y from the user you usually use an iterator, i, and start 1 at 0. While i < y, loop. When you loop, be sure to add 1 to i.

OpenStudy (e.mccormick):

start i at 0...

OpenStudy (anonymous):

@e.mccormick like this??

OpenStudy (e.mccormick):

"Repeat step number 2 y times" So you need is Count = to y? If yes, exit and print result. If no, count +=1 and x=x*2.

OpenStudy (anonymous):

ok

OpenStudy (anonymous):

@e.mccormick do you think my flowchart is already correct?

OpenStudy (e.mccormick):

|dw:1381724795449:dw|

OpenStudy (e.mccormick):

And generally you mark the yes and no parts on the question.

OpenStudy (e.mccormick):

OH! Almost forgot! |dw:1381725057087:dw|

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!