Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(Intro to Java help?) Write an interactive program that prompts for a desired sum, then repeatedly rolls two six-sided dice until their sum is the

(Intro to Java help?) Write an interactive program that prompts for a desired sum, then repeatedly rolls two six-sided dice until their sum is the desired sum. Here is the expected 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

Finish the following code file:

import java.util.*;

public class TestDiceRoll {

public static void main(String[] args) {

Scanner console = new Scanner(System.in);

System.out.print("Desired dice sum: ");

int sum = console.nextInt();

// your code here

}

}

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

More Books

Students also viewed these Databases questions