Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I want This in Java. For this program you will require user input, random numbers, and nested or compound conditional statements. You will need to

image text in transcribed

image text in transcribed

I want This in Java.

For this program you will require user input, random numbers, and nested or compound conditional statements. You will need to create a program that creates four random numbers, 1-6 each for two sets of dice. (This isn't as complicated as it may sound. Just make 4 random numbers and add the first two together for one total, and the second two for the other.) You will add the first two together to get the computer's total. You will add the second two together to get the player's total. Display the COMPUTER's total ONLY. Then ask the user whether they think their number is higher or lower. You can use the words higher/lower/tie or something like 1. higher, 2. lower 3. tie where you ask them to type in a 1 or a 2 instead. That's up to you. Display the USER's total now. Check to see if their guess is correct. If it is, then they win! Example 1: In this example, you guess correctly so you win Computer rolled 7 Will your number be: 1. Higher? 2. Lower? 3. Tie 1 Your number is 10 You win! Example 2: In this example, the numbers are the same, but the guess isn't correct so it's a loss. Computer rolled 7 Will your number be: 1. Higher? 2. Lower? 3. Tie? 2 Your number is 7 You lose

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

Databases Illuminated

Authors: Catherine Ricardo

2nd Edition

1449606008, 978-1449606008

More Books

Students also viewed these Databases questions