Question: Write a program, that simulates a betting game. It first asks the user for the original amount, A. As long as the user still

Write a program, that simulates a betting game. It first asks the 

Write a program, that simulates a betting game. It first asks the user for the original amount, A. As long as the user still has money (that is A is greater than 0), the program asks them to bet. The user indicates the amount of the bet and if it is a win or a loss by entering a positive or a negative value: - a positive value is a win and TWICE that much is added to A, - a negative amount is a loss and is subtracted from A. Sample run 1 Enter A: 100 Enter bet: 20 Now A is : 140 Enter bet: -50 Now A is : 90 Enter bet: 10 Now A is: 110 Enter bet: -130 Now A is : -20 Sample run 2 Enter A: 30 Enter bet: -10 Now A is : 20 Enter bet: -15 Now A is : 5 Enter bet: -5 Now A is : 0 Activate Windows

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres an example program in Java that simulates the described betting game java import javautilScann... View full answer

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 Programming Questions!