High/Low Flowchart help

This is a discussion on High/Low Flowchart help within the C++ Programming forums, part of the General Programming Boards category; Here are my directions: Design the flowchart for Exercise #14 (The High/Low game described in the Game Zone) at the ...

  1. #1
    Registered User
    Join Date
    Feb 2012
    Posts
    6

    High/Low Flowchart help

    Here are my directions: Design the flowchart for Exercise #14 (The High/Low game described in the Game Zone) at the end of chapter 5 in Programming Logic. This is to be written in Visio then exported from Visio to Word. You are to submit the Word document.

    Ok, Hi everyone, I have been lurking these forums for a few weeks and decided to finally register as there are some great people here. Anyway, I am needing some guidance/help on my flowchart. As of right now to me (i'm new to programming) this flowchart looks to be correct, but I know there is always room for improvement.
    Would this work or should I change it up?
    Thanks Guys
    Goodwin_Flowchart.pdf
    Last edited by onyxius; 02-04-2012 at 03:04 PM.

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    23,031
    You seem to have swapped Guess > number in the flowchart.
    Additionally, you seem to be repeating the same thing twice. You can just loop it again, obviously.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #3
    - - - - - - - - oogabooga's Avatar
    Join Date
    Jan 2008
    Posts
    2,808
    I know there is always room for improvement.
    It really is quite bad.

    I would get rid of both subroutines.

    finishUp is only doing one thing, so it just complicates things to put it in a subroutine.

    startMe (not a very good name) has the generation of the random number AND the input of the user's guess in it -- completely unrelated things. Get rid of the subroutine. Put the input of the guess in the inner loop, and leave the random number generation at the top of the outer loop, and then get rid of the repetition.

    Also, your "Yes" and "No" branches on "guess > number" need to be switched (if guess > number then the GUESS is too low, not the number).
    The cost of software maintenance increases with the square of the programmer's creativity. - Robert D. Bliss

  4. #4
    Registered User
    Join Date
    Feb 2012
    Posts
    6
    ok, I saw what you were talking about repeating and true about the finishup so i just put the output in. I swapped the yes and no for the guess. Does this look acceptable?

    He just changed some things. Here is what he has. I now need to figure out how to do the last bullet point. How many guesses it took. I'm not sure how to add that in there.

    Grading Rubric
    • Program generates a random number for the user to guess. 10 pts.
    • Program contains a loop to allow the user to guess multiple times. 20 pts
    • After each guess the program will print a message that the guess is too high or too low. 10 pts
    • Program prints the number of guesses it took to guess the correct answer. 10 pts
    Attached Images Attached Images
    Last edited by onyxius; 02-04-2012 at 04:58 PM.

  5. #5
    Registered User
    Join Date
    Feb 2012
    Posts
    6
    ok here is my attempt at adding the counter. I still feel like i'm maybe not doing the loop as good as i could be.
    Attached Images Attached Images

  6. #6
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    23,031
    This is one way of doing it. It is not bad.
    Just keep in mind thst you need to reset guesses if they want go replay. I suggest you separate initialize program from initialize game. Basically every time you run the game, you need to initialize the gsme. Every time you run the program, you need to initialize the program.

  7. #7
    Registered User
    Join Date
    Feb 2012
    Posts
    6
    Quote Originally Posted by Elysia View Post
    This is one way of doing it. It is not bad.
    Just keep in mind thst you need to reset guesses if they want go replay. I suggest you separate initialize program from initialize game. Basically every time you run the game, you need to initialize the gsme. Every time you run the program, you need to initialize the program.
    Are you referring to houseKeeping(), detailLoop(), endofJob()? keep each section separate?

  8. #8
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    23,031
    From Start to HouseKeeping().
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  9. #9
    Registered User
    Join Date
    Feb 2012
    Posts
    6
    Quote Originally Posted by Elysia View Post
    From Start to HouseKeeping().
    Ok, so if i'm understanding it correctly, move the line/arrow from input answer = Y pointing to housekeeping and move it to pointing to above declarations. or move declarations to housekeeping right?

  10. #10
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    23,031
    All I am saying is that you should consider what happens when the user is asked to play another game.
    Since counter = 0 belongs to your declarations section, it will never execute when branching to HouseKeeping(). Thus, you have a bug.
    That is why I am proposing that you separate what needs to be done once when the program starts and what needs to be done every time you re-start the game.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  11. #11
    Registered User
    Join Date
    Feb 2012
    Posts
    6
    Thank you everyone so very much for the guidance/help

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. High Low Game with High Scores
    By Bradley Buck in forum C Programming
    Replies: 24
    Last Post: 05-27-2011, 01:42 PM
  2. Need help with flowchart
    By moey187 in forum C++ Programming
    Replies: 2
    Last Post: 04-14-2011, 05:25 AM
  3. Replies: 0
    Last Post: 08-25-2010, 09:04 AM
  4. flowchart. Help!!!
    By chema124 in forum C Programming
    Replies: 3
    Last Post: 12-10-2002, 10:00 AM
  5. Flowchart
    By ob1cnobe in forum C++ Programming
    Replies: 4
    Last Post: 06-05-2002, 01:03 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21