Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a class named DiceGame.java that contains a method called diceSum that prompts the use for a desired sum, then repeatedly simulates the rolling of

Write a class named DiceGame.java that contains a method called diceSum that prompts the use for a desired sum, then repeatedly simulates the rolling of 2 six-sided dice until their sum is the desired sum (use a do/while loop). Here is a sample dialogue with the user: Desired dice sum: 9 4 and 3 = 7 3 and 5 = 8 5 and 6 = 11 5 and 6 = 11 1 and 5 = 6 6 and 3 = 9 You must perform checks to make sure the user enters an integer between 2 and 12 and reprompt if not. You must also reprompt for non-int values. Your code should include assertion comments for assertions that are always true (provable).

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_2

Step: 3

blur-text-image_3

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

Progress Monitoring Data Tracking Organizer

Authors: Teacher'S Aid Publications

1st Edition

B0B7QCNRJ1

More Books

Students also viewed these Databases questions

Question

b. Explain how you initially felt about the communication.

Answered: 1 week ago