Question: Java Program Aunt Vickie goes to Vegas Program Specifications: Vickie takes a jar which contains exactly 100 quarters to the casino with the intention to

Java Program Aunt Vickie goes to Vegas

Program Specifications:

Vickie takes a jar which contains exactly 100 quarters to the casino with the intention to win big. She plays three machines slot machines in sequence. Unknown to her, the machines are entirely predictable.

Must use random number generator in program.

Each play costs one quarter.

The following are constants:

The first machine pays 25 quarters every 35th time it is played.

The second machine pays 75 quarters every 100th time it is played.

The third pays 5 quarters every 8th time it is played.

So, Vickie will always lose - eventually.

Notice that she plays the machines one at a time in sequence: the first one, then the second one, the third one, the first one, the second one

Your program will output the number of times Vickie plays until she goes broke along with the result of each time she wins money. Besides main you must define and use at least 4 methods.

Your program will input the number of quarters in Vickies jar (it could be any number but for this assignment make it 100).

Your program will output a statement EVERYTIME Vickie wins money. The output will contain the following:

The Number of Machine (1, 2, or 3) that she just won on

The Amount she just won (formatted like dollars and cents)

The current number of quarters remaining in the jar immediately after the win and the amount of money in the jar (i.e. there are 47 quarters in the jar with equals $11.75.

Once Vickie is broke, you will output put the total number of times she was able to play the machines.

YOU CANNOT:

Use global variables

Use the word goto

Use the break command outside a case statement

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!