Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a flowchart and code for a dice rolling sub-method. The sub-method will have one double parameter and a void return type. The parameter will

Create a flowchart and code for a dice rolling sub-method. The sub-method will have one double parameter and a void return type. The parameter will determine th enumber simulated rolls of two six-sided dice. For each roll, the program will record the result. The possible results after rolling two six-sided dice are 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, and 12. After the rolls are completed, the program will display how many of each number was rolled along with the frequency. The frequency can be determined by the following formula:

Frequency of value x = (Rolls with result x/Total number of rolls)

For instance: If out of 10 rolls there were 2 sixes. The frequency of sixes would be 2/10 = .2 or 20%

The main method of your program will contain 3 calls to the dice rolling method.

The program needs to accept user input to determine the number of rolls

Run the three cases below

Case

Number of rolls

1

10

2

1000

3

10000

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

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Sham Navathe

4th Edition

0321122267, 978-0321122261

Students also viewed these Databases questions

Question

2. Define identity.

Answered: 1 week ago

Question

1. Identify three communication approaches to identity.

Answered: 1 week ago

Question

4. Describe phases of majority identity development.

Answered: 1 week ago