Question: java. also use if and switch statements Part 3: Programming with Selection Statements To Do: The classic casino game, Craps, involves rolling two six-sided dice
Part 3: Programming with Selection Statements To Do: The classic casino game, Craps, involves rolling two six-sided dice and evaluating the result of the roll. Given the exposed face of each die, the following are common nicknames for the roll: 1 2 3 5 6 Snake Eyes 1 2 Ace Deuce Hard Four 4 3 Easy Four Fever Five Fever Five Easy Six 5 Easy Six Seven Out 6 Seven Out Easy Eight Hard Six Seven Out Hard Eight Easy Eight Nine Nine Easy Ten Hard Ten Yo-leven Boxcards For example: 1) If both of the two dice are one, the name of the roll is Snake Eyes. 2) If both of the two dice are two, the name is Hard Four. 3) If one dice is 1 and the other dice 3, the name is Easy Four. I Write a program, called Craps.java, that simulates the game described above. Your program should: 1) Ask the user if they want to randomly cast dice or if they'd like to state the two dice they want to evaluate. a) If they want to randomly cast dice, generate two random numbers from 1-6, inclusive, representing the outcome of the two dice cast in the game. b) If they want user-provided dice, use the Scanner twice to ask the user for two integers from 1-6, inclusive. (For now, you can assume the user will input integers and that they will be in the correct range.) 2) Using the two values determined in (1), select the correct slang terminology of the outcome of the roll. 3) Print out the nickname of the roll (according to the chart above)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
