Problem 7: Guess the price of the car!? You will implement a variant of the number guessing game we played in lecture. In this variant, you will ask the user to guess the price of a $42,500 car. Let's...


Problem 7: Guess the price of the car!?<br>You will implement a variant of the number guessing game we played in<br>lecture. In this variant, you will ask the user to guess the price of a<br>$42,500 car. Let's assume that the player knows the price of the car is<br>rounded to the nearest $500. If a player's guess is not exactly correct, your<br>program will tell them they are either too high or too low. The player will get<br>as many guesses as they need to guess the price of the $42,500 car.<br>However they will only win the game if they used 5 or fewer guesses.<br>Here are two examples of how the program should work for both cases:<br>Guess the price and win the prize!<br>Enter your guess:50000<br>Too high!<br>Enter your guess:40000<br>Too low!<br>Enter your guess:45000<br>Too high!<br>Enter your guess:42500<br>You won the car!<br>Guess the price and win the prize!<br>Enter your guess:46000<br>Too high!<br>Enter your guess:45000<br>Too high!<br>Enter your guess:44000<br>Too high!<br>Enter your guess:43000<br>Too high!<br>Enter your guess:42000<br>Too low!<br>Enter your guess:42500<br>Too many guesses!<br>

Extracted text: Problem 7: Guess the price of the car!? You will implement a variant of the number guessing game we played in lecture. In this variant, you will ask the user to guess the price of a $42,500 car. Let's assume that the player knows the price of the car is rounded to the nearest $500. If a player's guess is not exactly correct, your program will tell them they are either too high or too low. The player will get as many guesses as they need to guess the price of the $42,500 car. However they will only win the game if they used 5 or fewer guesses. Here are two examples of how the program should work for both cases: Guess the price and win the prize! Enter your guess:50000 Too high! Enter your guess:40000 Too low! Enter your guess:45000 Too high! Enter your guess:42500 You won the car! Guess the price and win the prize! Enter your guess:46000 Too high! Enter your guess:45000 Too high! Enter your guess:44000 Too high! Enter your guess:43000 Too high! Enter your guess:42000 Too low! Enter your guess:42500 Too many guesses!

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here