Answered step by step
Verified Expert Solution
Question
1 Approved Answer
this is JAVA assignment. Don't copy and please go through the assignments, the probability and all the requirement has been changed. Don't copy some online
this is JAVA assignment. Don't copy and please go through the assignments, the probability and all the requirement has been changed. Don't copy some online HW version. Be able to follow the comments
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 amountStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started