Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Nov 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    creating a flowchart for a while loop

    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

    thanks Krystyna

  • #2
    Senior Coder nikos101's Avatar
    Join Date
    Dec 2006
    Location
    London
    Posts
    1,005
    Thanks
    58
    Thanked 10 Times in 10 Posts
    Is this homework?

  • #3
    New to the CF scene
    Join Date
    Nov 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by nikos101 View Post
    Is this homework?
    yes,

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

  • #4
    Senior Coder nikos101's Avatar
    Join Date
    Dec 2006
    Location
    London
    Posts
    1,005
    Thanks
    58
    Thanked 10 Times in 10 Posts
    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.

  • #5
    New to the CF scene
    Join Date
    Nov 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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...

  • #6
    Senior Coder nikos101's Avatar
    Join Date
    Dec 2006
    Location
    London
    Posts
    1,005
    Thanks
    58
    Thanked 10 Times in 10 Posts


    oops see that arrow

    Code:
    is Total < than 25
    that should be

    Code:
    is Total > than 25
    Last edited by nikos101; 11-03-2007 at 12:45 PM.

  • #7
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,801
    Thanks
    160
    Thanked 2,216 Times in 2,203 Posts
    Blog Entries
    1
    Well, have a look at Flowchart Symbols
    and CF Rules (#1.5)
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •