playing dice, or guessing a number games program
, asking the user to choose between the two games,or exit. It is up to you to design this prompt.
Each game must be programmed in its own function, not in main()! main will call the games’functions.
At the end of each game, the user is returned to the
- The user is asked to pick a number between 2 and 12.
- The computer rolls two dice, using random variables, and adds up the score on each die.
Since each die can score from 1 to 6, the total score can be from 2 to 12.
- If the roll matches the user’s picked number, the user wins; otherwise, the user loses.
- The computer informs the user of the result (win or loss), and this game ends.
[COLOR=rgb(0.000000%, 0.000000%, 100.000000%)]Guess a number:[/COLOR]
- The computer randomly selects a number between 0 and 100.
- The computer asks the user to guess the number.
- The computer informs the user if the user’s guess is too high, too low, or right on. In the latter
case, the user wins and we jump to step 4. Otherwise, we repeat from step 2 and the user will
- In this step the user has won. The computer tells the user how many tries it took for the user
to guess it right, and this game ends.
I already started something and this is what i have...I'm not asking you to do it, I want to know if I'm on the right track and if I've already made some mistakes, please correct me.