1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
svetoff [14.1K]
3 years ago
11

Create a new Die object. (Refer to Die.html for documentation.)Create a loop that will iterate at least 100 times. In the loop b

ody:Roll the die. (Don't create a new object, just roll it again.)Based on the result of the roll, increment the corresponding cell of your array.
Computers and Technology
1 answer:
hjlf3 years ago
8 0

Answer:

Java code is given below

Explanation:

import java.util.Random;

class Die{

private int sides;

public Die(){

sides = 6;

}

public Die(int s){

sides = s;

}

public int Roll(){

Random r = new Random();

return r.nextInt(6)+1;

}

}

class DieRoll{

public static void main(String[] args) {

Die die = new Die();

int arr[] = new int[6];

for(int i=0; i<6; i++)

arr[i] = 0;

for(int i=0; i<100; i++){

int r = die.Roll();

arr[r-1]++;

}

for(int i=0; i<6; i++)

System.out.println((i+1)+" was rolled "+arr[i]+" times.");

}

}

You might be interested in
Imagine a typical website that works as a storefront for a business, allowing customers to browse goods online, place orders, re
Gwar [14]

Answer: See explanation

Explanation:

Following the information given in the question, the testing process for the website will include testing the links that are on the site.

Another that ng to test is to check if the menus and the buttons are working properly. Furthermore, the layout should be ensured that it's consistent as well as the ease with which the website can be used.

5 0
3 years ago
PLZ ANSWER WORTH 20 POINTS!! URGENT!
omeli [17]

Answer:

C. a registered Microsoft Account

8 0
3 years ago
Read 2 more answers
What key stage involves considering design options?
Grace [21]

Answer: Formulating your brief

Explanation:

The key stage that involves considering design options is formulating one's brief.

The aim of "Formulating Your Brief" is simply a way to determine the context in which a particular work will be to be undertaken after which the aim is then defined. It can either be formal or informal.

7 0
3 years ago
A photograph is taken by letting light fall on a light-sensitive medium, which then records the image onto that medium.
Andru [333]
True. At least that's how it is for camera's that print photos. Not digital cameras
4 0
3 years ago
Read 2 more answers
The freemen's bureau was the U.S.' first ____ program.​
Ludmilka [50]

Answer:

welfare

Explanation:

The Freemen's bureau was the first Welfare program in the US that was put forward in the year 1865 just after the assassination of Abraham Lincoln. It was headed by Oliver O Howard. And it was brought for providing the food, clothing, medical care, and education to the recently freed white refugees and the freed slaves. And it was supposed to be a kind of welfare.  

6 0
3 years ago
Other questions:
  • Click _______ to add a new column to a table.
    12·2 answers
  • “Green Technology” is also known as what?
    11·1 answer
  • Samantha was calculating a mathematical formula on an electronic spreadsheet. She used multiple values to recalculate the formul
    8·2 answers
  • Cognitive psychology is the scientific study of what
    9·1 answer
  • Which type of computer is the best? laptop, tablet, or desktop
    15·2 answers
  • In an information systems framework, ________ is the bridge between the computer side on the left and the human side on the righ
    14·1 answer
  • What are the five generations of computers?​
    13·1 answer
  • State whether the given HTML coding is True or False. &lt;HR SIZE=5 COLOR=YELLOW ALIGN=RIGHT WIDTH=75%&gt;​
    9·1 answer
  • A common hardware component found in electronic devices including desktop computers, laptops, tablets and smartphones. The amoun
    5·1 answer
  • In ip address 202.54.15.178, 15.178 is ______ address.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!