Question: THIS IS A JAVA COMPUTER SCIENCE HW Assignment 7 - Casino with Methods and a Class For this assignment you will have to investigate the

THIS IS A JAVA COMPUTER SCIENCE HW Assignment 7 - Casino withMethods and a Class For this assignment you will have to investigatethe use of the Java random number generator function, Math.random (). Youcan find this in the text. A Slot Machine Simulation Understand theApplication What it Looks Like to the User . If the Theprogram will loop, asking the user for a bet amount from Oto 50 (assume dollars, you can use ints or longs) user typesa O that means she wants to quit. Otherwise, accept the amountTHIS IS A JAVA COMPUTER SCIENCE HW

Assignment 7 - Casino with Methods and a Class For this assignment you will have to investigate the use of the Java random number generator function, Math.random (). You can find this in the text. A Slot Machine Simulation Understand the Application What it Looks Like to the User . If the The program will loop, asking the user for a bet amount from O to 50 (assume dollars, you can use ints or longs) user types a O that means she wants to quit. Otherwise, accept the amount as their bet and simulate a slot machine pull Your program will print out a line that looks like a slot machine result containing three strings. Some examples are: BAR Each of the three positions in the string could be one of the following: "BAR", "7", "cherries" or "space". Each of the three output positions must be generated by your program randomly with probabilities (defined, as always, by final statics) (38%) (40%) (796) BAR cherries o Pace (1596) Therefore, cherries should be the most frequent symbol seen and space or 7 the least frequent. The following combinations should pay the bet as shown (note ORDER MATTERS) [not cherries] [any] pays 5 bet (5 times the bet) cherries [not cherries] pays 15 bet cherries o cherries cherries cherries cherries pays 30% bet BAR BAR BAR pays 50x bet pays 100% bet . After the pull, display the three strings regardless of the outcome. If the user did not win, tell him/her "Sorry, you lose." If he won, pay him by displaying his winnings (his original bet times the winning factor from the above table) Then, repeat the whole process by requesting another bet amount

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!