GAME MENU: -------------------------- 1: PLAY Guess the Number 2: PLAY High Low 3: PLAY Collect Pairs 4: VIEW Statistics 5: RESET Statistics 6: RULES 0: QUIT -------------------------- >The user can select any of the options. If they select a number besides 1,2,3,4,5,6,or 0 print an error message and force them to re-enter until they enter a valid value (You'll need a loop to force a valid entry).
Generate a random number between 1 and 100. The user then has 6 tries to guess the secret number. If they guess the number within 6 tries, they win, and the function returns true back to main(). If they do not guess the number within 6 tries, they lose, and the function returns false back to main(). On each try, print out a message indicating whether the number was too big or too small.
Generate a random number between 1 and 1000 as the starting random number. The user needs to tell us whether the NEXT random number will be Higher or Lower than the current one, denoting this by entering H for higher or L for lower. The user must enter H or L here. Do not let them proceed until they do. If the user succeeds in guessing high or low correctly 5 times in a row, they win, and the function returns true back to main(). If the user gets any of their guesses wrong before 5 correct guesses, they lose.
The goal of this game is to obtain a pair of each type: 1's, 2's, 3's, 4's, 5's, and 6's when a pair of dice are rolled. Simulate rolling a pair of dice 100 times. When you encounter the first (and only the first) of any pair, print out a message indicating that that pair has been found and accounted for. After the 100 rolls, if the user had encountered a pair of every kind, they win, and the function should return true back to main(). If the user did not encounter all of the pairs after their 100 rolls, they lose, and the function should return false back to main().
You must have these 5 functions (explained above) in your program, in
addition to main(), to earn points for these tasks. You're allowed to
create any additional functions if you choose.
GAME MENU: -------------------------- 1: PLAY Guess the Number 2: PLAY High Low 3: PLAY Collect Pairs 4: VIEW Statistics 5: RESET Statistics 6: RULES 0: QUIT -------------------------- > 1 Guess the Number, 1 --> 100! Attempt 1/6 : 50 TOO SMALL. Attempt 2/6 : 75 TOO BIG. Attempt 3/6 : 60 TOO SMALL. Attempt 4/6 : 68 TOO BIG. Attempt 5/6 : 65 TOO BIG. Attempt 6/6 : 63 TOO BIG. Sorry, you lose. The number was 62 GAME MENU: -------------------------- 1: PLAY Guess the Number 2: PLAY High Low 3: PLAY Collect Pairs 4: VIEW Statistics 5: RESET Statistics 6: RULES 0: QUIT -------------------------- > 1 Guess the Number, 1 --> 100! Attempt 1/6 : 50 TOO SMALL. Attempt 2/6 : 75 TOO SMALL. Attempt 3/6 : 85 TOO SMALL. Attempt 4/6 : 93 You WIN! GAME MENU: -------------------------- 1: PLAY Guess the Number 2: PLAY High Low 3: PLAY Collect Pairs 4: VIEW Statistics 5: RESET Statistics 6: RULES 0: QUIT -------------------------- > 2 High or Low! Stay alive for 5 rounds to win! (Numbers range from 1 to 1,000) Round 1 of 5. The number is 83 ... is the next number [H]igher or [L]ower?: H The next number is: 627 Correct! Round 2 of 5. The number is 627 ... is the next number [H]igher or [L]ower?: L The next number is: 474 Correct! Round 3 of 5. The number is 474 ... is the next number [H]igher or [L]ower?: H The next number is: 788 Correct! Round 4 of 5. The number is 788 ... is the next number [H]igher or [L]ower?: L The next number is: 600 Correct! Round 5 of 5. The number is 600 ... is the next number [H]igher or [L]ower?: L The next number is: 42 Correct! You WIN! GAME MENU: -------------------------- 1: PLAY Guess the Number 2: PLAY High Low 3: PLAY Collect Pairs 4: VIEW Statistics 5: RESET Statistics 6: RULES 0: QUIT -------------------------- > 4 STATISTICS: ------------------------- Wins: 2 Losses: 1 Total Win Percent: 66.7% GAME MENU: -------------------------- 1: PLAY Guess the Number 2: PLAY High Low 3: PLAY Collect Pairs 4: VIEW Statistics 5: RESET Statistics 6: RULES 0: QUIT -------------------------- > 5 Statistics Reset! GAME MENU: -------------------------- 1: PLAY Guess the Number 2: PLAY High Low 3: PLAY Collect Pairs 4: VIEW Statistics 5: RESET Statistics 6: RULES 0: QUIT -------------------------- > 0 STATISTICS: ------------------------- Wins: 0 Losses: 0 Total Win Percent: 0.0% Thanks for playing!
GAME MENU: -------------------------- 1: PLAY Guess the Number 2: PLAY High Low 3: PLAY Collect Pairs 4: VIEW Statistics 5: RESET Statistics 6: RULES 0: QUIT -------------------------- > 3 Rolling a pair of dice 100 times for pairs! PAIR OF ONES found PAIR OF FIVES found PAIR OF THREES found PAIR OF TWOS found PAIR OF SIXES found PAIR OF FOURS found You WIN! GAME MENU: -------------------------- 1: PLAY Guess the Number 2: PLAY High Low 3: PLAY Collect Pairs 4: VIEW Statistics 5: RESET Statistics 6: RULES 0: QUIT -------------------------- > 3 Rolling a pair of dice 100 times for pairs! PAIR OF FIVES found PAIR OF SIXES found PAIR OF FOURS found PAIR OF THREES found PAIR OF ONES found Sorry, you lose. GAME MENU: -------------------------- 1: PLAY Guess the Number 2: PLAY High Low 3: PLAY Collect Pairs 4: VIEW Statistics 5: RESET Statistics 6: RULES 0: QUIT -------------------------- > 3 Rolling a pair of dice 100 times for pairs! PAIR OF TWOS found PAIR OF FOURS found PAIR OF SIXES found PAIR OF THREES found Sorry, you lose. GAME MENU: -------------------------- 1: PLAY Guess the Number 2: PLAY High Low 3: PLAY Collect Pairs 4: VIEW Statistics 5: RESET Statistics 6: RULES 0: QUIT -------------------------- > 4 STATISTICS: ------------------------- Wins: 1 Losses: 2 Total Win Percent: 33.3% GAME MENU: -------------------------- 1: PLAY Guess the Number 2: PLAY High Low 3: PLAY Collect Pairs 4: VIEW Statistics 5: RESET Statistics 6: RULES 0: QUIT -------------------------- > 8 Enter an item on the Menu: 9 Enter an item on the Menu: 8 Enter an item on the Menu: -10 Enter an item on the Menu: 0 STATISTICS: ------------------------- Wins: 1 Losses: 2 Total Win Percent: 33.3% Thanks for playing!
GAME MENU: -------------------------- 1: PLAY Guess the Number 2: PLAY High Low 3: PLAY Collect Pairs 4: VIEW Statistics 5: RESET Statistics 6: RULES 0: QUIT -------------------------- > 2 High or Low! Stay alive for 5 rounds to win! (Numbers range from 1 to 1,000) Round 1 of 5. The number is 16 ... is the next number [H]igher or [L]ower?: X Enter H or L: Z Enter H or L: P Enter H or L: H The next number is: 154 Correct! Round 2 of 5. The number is 154 ... is the next number [H]igher or [L]ower?: L The next number is: 92 Correct! Round 3 of 5. The number is 92 ... is the next number [H]igher or [L]ower?: H The next number is: 152 Correct! Round 4 of 5. The number is 152 ... is the next number [H]igher or [L]ower?: H The next number is: 256 Correct! Round 5 of 5. The number is 256 ... is the next number [H]igher or [L]ower?: H The next number is: 627 Correct! You WIN! GAME MENU: -------------------------- 1: PLAY Guess the Number 2: PLAY High Low 3: PLAY Collect Pairs 4: VIEW Statistics 5: RESET Statistics 6: RULES 0: QUIT -------------------------- > 6 RULES: Guess the Number Game: You'll only get 6 tries to guess a number between 1 and 100! Guess Wisely! High/Low Game: Make it through 5 rounds of guessing whether the next random number between 1 and 1,000 is higher or lower than the previous, and you win! Collect the Pairs Game: Roll two dice 100 times. If in the 100 times you roll a pair of each type (1's, 2's, 3's, 4's, 5's, 6's) at least once, then YOU WIN! GAME MENU: -------------------------- 1: PLAY Guess the Number 2: PLAY High Low 3: PLAY Collect Pairs 4: VIEW Statistics 5: RESET Statistics 6: RULES 0: QUIT -------------------------- > 0 STATISTICS: ------------------------- Wins: 1 Losses: 0 Total Win Percent: 100.0% Thanks for playing!
GAME MENU: -------------------------- 1: PLAY Guess the Number 2: PLAY High Low 3: PLAY Collect Pairs 4: VIEW Statistics 5: RESET Statistics 6: RULES 0: QUIT -------------------------- > 2 High or Low! Stay alive for 5 rounds to win! (Numbers range from 1 to 1,000) Round 1 of 5. The number is 325 ... is the next number [H]igher or [L]ower?: H The next number is: 911 Correct! Round 2 of 5. The number is 911 ... is the next number [H]igher or [L]ower?: L The next number is: 211 Correct! Round 3 of 5. The number is 211 ... is the next number [H]igher or [L]ower?: L The next number is: 232 Sorry, you lose. GAME MENU: -------------------------- 1: PLAY Guess the Number 2: PLAY High Low 3: PLAY Collect Pairs 4: VIEW Statistics 5: RESET Statistics 6: RULES 0: QUIT -------------------------- > 0 STATISTICS: ------------------------- Wins: 0 Losses: 1 Total Win Percent: 0.0% Thanks for playing!
~myers/csub/submit4 games.cpp