) In the Hi-Lo game, the player begins with a score of 1000. The player is prompted for the number of points to risk and a second prompt asks the player to choose either High or Low. The player’s choice of either High or Low is compared to a random number between 1 and 13, inclusive. If the number is between 1 and 6 inclusive, then it is considered “low”. A number between 8 and 13 inclusive is “high”. The number 7 is neither high nor low, and the player loses the points at risk. If the player had guessed correctly, the points at risk are doubled and added to the total points. For a wrong choice, the player loses the points at risk. Create a HiLo application based on this specification. Application output should look similar to   b) Modify the application to allow the player to continue until there are 0 points left. At the end of the game, display the number of guesses the user took before running out of points.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter6: Looping
Section: Chapter Questions
Problem 5GZ
icon
Related questions
Question

a) In the Hi-Lo game, the player begins with a score of 1000. The player is prompted for the number of points to risk and a second prompt asks the player to choose either High or Low. The player’s choice of either High or Low is compared to a random number between 1 and 13, inclusive. If the number is between 1 and 6 inclusive, then it is considered “low”. A number between 8 and 13 inclusive is “high”. The number 7 is neither high nor low, and the player loses the points at risk. If the player had guessed correctly, the points at risk are doubled and added to the total points. For a wrong choice, the player loses the points at risk. Create a HiLo application based on this specification. Application output should look similar to

 

b) Modify the application to allow the player to continue until there are 0 points left. At the end of the game, display the number of guesses the user took before running out of points. 

 

High Low Game
RULES
Numbers 1 through 6 are low
Numbers 8 through 13 are high
Number 7 is neither high or low
You have 1000 points.
Enter points to risk: 500
Predict (1=High, 0-Low>: 0
Number is 4
You win.
Play again? y
You have 2000 points.
Transcribed Image Text:High Low Game RULES Numbers 1 through 6 are low Numbers 8 through 13 are high Number 7 is neither high or low You have 1000 points. Enter points to risk: 500 Predict (1=High, 0-Low>: 0 Number is 4 You win. Play again? y You have 2000 points.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT