...

View Full Version : creating a flowchart for a while loop



krystyna93
11-03-2007, 10:58 AM
Hello there fellow programmers,

i have a bit of problem trying to create a flowchart for this pseudo code below...:(

could anyone help me out?

--------

Enrolment
TotalStudents = 0
CLASS_MAX = 25
WHILE TotalStudents <=CLASS_MAX
INPUT StudentName
INPUT StudentPhone
WRITE StudentName
WRITE StudentPhone
TotalStudents = TotalStudents + 1
ENDWHILE
DISPLAY ClassFullMsg
END

----------

your help will be much appreciated:thumbsup:

thanks Krystyna

nikos101
11-03-2007, 11:09 AM
Is this homework?

krystyna93
11-03-2007, 11:27 AM
Is this homework?
yes,

it has taken me two weeks to figure it out but no luck..

nikos101
11-03-2007, 11:48 AM
thanks for your honesty:)

You only have the one loop here, and when TotalStudents is greater than CLASS_MAX the loop ends. Just draw a box with a line going in at the top of the box and a line going out. the line going out goes back to the top of the box if the condition is less than CLASS_MAX.

btw Welcome of the forum, sorry about the tone of the first reply.

krystyna93
11-03-2007, 12:04 PM
thanks for your reply,

would it be okay of you could draw it out for me?

its not clear to me how you have written it

sorry if this is too much...

nikos101
11-03-2007, 12:40 PM
http://ecommercetotal.co.uk/images/hotlinking/lastscan.jpg

oops see that arrow


is Total < than 25

that should be


is Total > than 25

abduraooft
11-03-2007, 01:34 PM
Well, have a look at Flowchart Symbols (http://www.wiley.com/college/busin/icmis/oakman/outline/chap05/slides/symbols.htm)
and CF Rules (#1.5) (http://www.codingforums.com/rules.htm)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum