subject
Engineering, 31.03.2020 00:03 bevanscory123

Your task is to write a simple guessing game in C++. Your program must generate a pseudo-random number between 1 and 100, inclusive. The user will then be presented with opportunities to guess the number. After each guess, the program must indicate whether the guess was too high, too low, or correct. To make the game more interesting, the user will bet on each number. Initially, the program will give the user $1000. Each round, prompt the user for a bet. Then prompt for guesses until the user is correct, or has made 6 wrong guesses. The payoff is calculated as follows: 1. If the player guesses correctly within the first 6 guesses, the player wins bet / # guesses. So if the player bet $100 and correctly guessed on the 4th try, the payoff is $25. 2. If the player does not guess correctly within the first 6 guesses, the player loses the amount bet. Once the round has ended (either by a correct guess or by using up the 6 guesses), the program must display the current status (see the sample execution output below for the minimum required information) and prompt the user to see if he/she wants to play again. This will continue until the user indicates that they do not want to play again or until the player runs out of money.

ansver
Answers: 2

Another question on Engineering

question
Engineering, 04.07.2019 18:10
What difference(s) did you notice using a pneumatic circuit over hydraulic circuit.explain why the pneumatic piston stumbles when it hits an obstacle.
Answers: 2
question
Engineering, 04.07.2019 18:10
The higher the astm grain-size number, the coarser the grain is. a)-true b)-false
Answers: 3
question
Engineering, 04.07.2019 18:10
The drive force for diffusion is 7 fick's first law can be used to solve the non-steady state diffusion. a)-true b)-false
Answers: 1
question
Engineering, 04.07.2019 18:20
Avolume of 2.65 m3 of air in a rigid, insulated container fitted with a paddle wheel is initially at 264 k, 5.6 bar. the air receives 432 kj by work from the paddle wheel. assuming the ideal gas model with cv = 0.71 kj/kg • k, determine for the air the amount of entropy produced, in kj/k
Answers: 2
You know the right answer?
Your task is to write a simple guessing game in C++. Your program must generate a pseudo-random numb...
Questions
question
Computers and Technology, 17.09.2019 21:00
Questions on the website: 13722362