Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program called DiceRoller2.java Your program will do the following I. Ask the user how many sides his/her dice have (assume 2 dice of

image text in transcribed
Write a program called DiceRoller2.java Your program will do the following I. Ask the user how many sides his/her dice have (assume 2 dice of the same # sides). Be sure to validate the input (print out Invalid input if it's not valid). What is the fewest number of sides a die can have? 2. Roll the two dice. 3. Print the values rolled on two separate lines 4. Print the sum of the two dice on a third line. Here is an example of what the user will see (italics indicate user input): How many sides on your dice? 2 Invalid input How many sides on your dice? 27 13 24 37

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

MySQL/PHP Database Applications

Authors: Brad Bulger, Jay Greenspan, David Wall

2nd Edition

0764549634, 9780764549632

More Books

Students also viewed these Databases questions