Question: Struggling with this program in JAVA , and need help. THANKS! Here are the constraints and format. You will write a game. The game starts

Struggling with this program in JAVA, and need help. THANKS!

Here are the constraints and format.

Struggling with this program in JAVA, and need help. THANKS! Here arethe constraints and format. You will write a game. The game starts

You will write a game. The game starts by giving the player $500. The game prompts the player for the amount they want to bet, and the sum of two randomly rolled dice. If the player guesses the sum correctly, the player wins some money based on the rules below. If the player guesses wrong, the player loses the amount that was bet. The game repeats until either the player runs out of money, or the player chooses to stop playing. Here are the rules for winning and losing. - If the sum matches the sum of the dice, and the two dice have the same value, the winning amount is twice the bet. For example, if the player bets $100, and the player guesses four as the sum, and the first die is two and the second die is two, then the player is awarded $200, which is twice the bet of $100. - If the sum matches the sum of the dice, but the two dice have different values, then the winning amount is the same as the bet. - If the player guesses the wrong sum, they lose the amount equal to the bet. - Make sure the player does not bet more than they have, or a negative amount. If the amount is negative or greater than the amount they have, ask the player to reenter the bet. - Make sure the player types Y,y,N or n when prompted to continue the game. If the player enters anything else, the game should ask the player to reenter the answer. Welcome to the Game. You are given $500 to start. You can't play once you run out of money. How much are you betting? 250 Rolling the dice.... What is the sum of the two dice? 5 Die 1 is 3 Die 2 is 2 You win \& 250 Your current balance is $750 Do you want another game? Y/N : Y How much are you betting? 100 What is the sum of the two dice? 4 Die 1 is 3 Die 2 is 5 You lost $100 Your current balance is \& 650 Do you want another game? Y/N : Y How much are you betting? 100 Rolling the dice.... What is the sum of the two dice? 10 Die 1 is 5 Die 2 is 5 You win $200 Your current balance is \$ 850 Do you want another game? Y/N : Y How much are you betting? 850 Rolling the dice.... What is the sum of the two dice? 8 Your current balance is $0 Sorry, you are out of money. See you later

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!