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
Why do so many people think the revision stage is the hardest
tia_tia [17]

It is because many people want to be perfect just at the start, but there is always room to improvement, but people don't accept that, so they don't want to be better than what they are already, so the don't revise themselves or anything.


6 0
3 years ago
Read 2 more answers
Risk of new technology is NOT evaluated by asking questions during which phase?
neonofarm [45]

Answer:

the answer is D

Explanation:

hope this helps :)

4 0
3 years ago
The person or persons requesting the worksheet should supply their requirements in a _____ document
ziro4ka [17]
<span>The person or persons requesting the worksheet should supply their requirements in a requirements document. </span>
3 0
3 years ago
To freeze rows 1 and 2, and columns 1, 2, and 3, which cell should you highlight before selecting freeze panes?.
Brilliant_brown [7]

In the case above, the cell that you can highlight before selecting freeze panes is row 3 column 4.

<h3>How do one freeze several column?</h3>

This can be done when a person select the column that's is said to be next to the right of the last column a person want to freeze.

Therefore, In the case above, the cell that you can highlight before selecting freeze panes is row 3 column 4.

Learn more about panes from

brainly.com/question/17194167

#SPJ1

4 0
1 year ago
What color typically indicates the speaker port on a sound card?
allsm [11]
The answer to this question would be: Lime green

The lime green color code is for audio output for speaker or headphones. Color coding is greatly helpful to make sure that the port you are using is correct. Using the color you can determine what kind of input or output the port is for. There is a few others color coding like pink for analog microphone input, or light blue for audio input of analog line.
4 0
3 years ago
Read 2 more answers
Other questions:
  • All languages from the second generation on must be translated into machine language for the computer to be able process the inp
    8·1 answer
  • The a0 is the part of the central processing unit that performs arithmetic calculations for the computer.
    8·1 answer
  • A typical serial cable has
    13·1 answer
  • Hot five was the famous band of which musician?
    14·1 answer
  • Hidden costs of computers into our schools
    13·1 answer
  • The term that refers to the standard computer language for creating web pages is called:
    6·1 answer
  • how risk can impact each of the seven domains of a typical IT infrastructure: User, Workstation, Local Area Network (LAN), Local
    7·1 answer
  • What are 3 examples of a idler gear in real life?
    7·1 answer
  • A (n) ___ system can help a business alleviate the need for multiple information systems.
    13·1 answer
  • HURRY PLS
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!