Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

java. also use if and switch statements image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data Systems A 360-degree Approach

Authors: Jawwad ShamsiMuhammad Khojaye

1st Edition

0429531575, 9780429531576

More Books

Students also viewed these Databases questions

Question

What is the basis for Security Concerns in Cloud Computing?

Answered: 1 week ago

Question

Describe the three main Cloud Computing Environments.

Answered: 1 week ago