In C++ I have to create a guessing game that has three loops and and I have to make a flowchart. Now mind you I am a beginner at all of this. Someone help!
How do I get started in making a guessing game?
Collapse
X
-
The specifications
Dealing wih numbers.
First loop: A for loop and should count up from 1 to 4.
Second loop: A while loop and should caount from 4 to 1.
Third loop: A do...while loop and should count up from 1 to 4 in increments of 2.
The second part deals with automating the guessing and high/low decision. No user input required.
I basically just need help on setting it up.Comment
-
I assume the flow chart simply explains how the game works.
If that is correct why dont you post your chart and also the code which supports it identifying where you are having problems.
A simple guessing game usually requires the the generation of random numbers based on a seed (integer).i.e. ask the user to enter a number between 10 and 20 and use this for the seed to generate the 4 random numbers between 1 and 10. This happens every cycle of the while loop referred to below. Now you have the numbers (say 1,5,3,8)
Now (within the while loop) ask the user to guess the four numbers with cin>>n; in a four loop.
Report the degree of success each cycle of the while loop.Comment
Comment