Results 1 to 2 of 2

Thread: Flowchart and pseudocode

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2009
    Posts
    35

    Smile Flowchart and pseudocode

    I didn't know where to put this subject matter, So I'll put it in here for now.

    Need help with flowchart and Pseudocode.
    I Have my flowchart drawn (two story elevator flowchart), but my friend told me its not structured. Which parts aren't structured and how do I structure it like this:

    He said to look at page 4, to get ideas on a structured flowchart.

    http://claymore.engineer.gvsu.edu/~b...Flowcharts.pdf

    Please! NEED HELP PRONTO!

    I attached my flowchart to this post.
    Also here is the image file:
    Attached Files Attached Files

  2. #2
    PowerPoster Jenner's Avatar
    Join Date
    Jan 2008
    Location
    Mentor, OH
    Posts
    3,712

    Re: Flowchart and pseudocode

    I think what your friend is getting at, is you should be flowcharting EVERY floor. In programming, you should never have to repeat code for EVERY similar action. That's what loops are for.

    Look at your floor 1 and floor 2 blocks, they're identical except for the direction the elevator travels and the floor number. What if you were making the flowchart for the Empire State Building? You going to have 102 blocks for every single floor? No, you're only going to have one block called "N floor" and checks for calls > N floor? Button for > N floor pressed? Check for calls to < N floor? Button for < N floor pressed? Then a way to determine if its got to move up or down.

    The final logic should be something like:
    I am on N floor. What was my last movement? Was the last movement up?

    Yes: Are there any calls/button presses for > N floor? Yes: keep going up. No: are there any calls/button presses for < N floor? Yes: go down. No: There are no requests, go to floor 1 and park.

    No: Last movement was down, are there any calls/button presses for < N floor? Yes: keep going down. No: are there any calls/button presses for > N floor? Yes: Go up. No: there are no requests, go to floor 1 and park.

    Loop back to top.
    My CodeBank Submissions: TETRIS using VB.NET2010 and XNA4.0, Strong Encryption Class, Hardware ID Information Class, Generic .NET Data Provider Class, Lambda Function Example, Lat/Long to UTM Conversion Class, Audio Class using BASS.DLL

    Remember to RATE the people who helped you and mark your forum RESOLVED when you're done!

    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe. "
    - Albert Einstein

Posting Permissions

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



Click Here to Expand Forum to Full Width