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, 03.07.2019 23:20
Two technicians are discussing the intake air temperature (iat) sensor. technician a says that the computer uses the iat sensor as a backup to the engine coolant temperature (ect) sensor. technician b says that the powertrain control module (pcm) will subtract the calculated amount of fuel if the air measures hot. who is correct
Answers: 3
question
Engineering, 04.07.2019 16:10
The force on a cutting tool are 2600n vertically downward and 2100 horizontal. determine the resultant force acting on the tool and the angle at which it acts.
Answers: 1
question
Engineering, 04.07.2019 18:10
The filament of an incandescent lamp has a temperature of 2000k. calculate the fraction of radiation emitted in the visible light band if the filament is approximated as blackbody
Answers: 2
question
Engineering, 04.07.2019 18:10
Which of the following components of a pid controlled accumulates the error over time and responds to system error after the error has been accumulated? a)- proportional b)- derivative c)- integral d)- on/off.
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
Mathematics, 04.05.2021 18:00
question
History, 04.05.2021 18:00
question
Mathematics, 04.05.2021 18:00
Questions on the website: 13722361