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
The automotive system that connects the engine and the transmission to the wheels is called the
insens350 [35]
I believe the driveshaft 

8 0
3 years ago
ANSWER IN 5 MINUTES TO GET 50 POINTS!!!
Luba_88 [7]
The answer is d. Hope that helps.
7 0
3 years ago
The range of an area where users can access the Internet via high-frequency radio signals transmitting an Internet signal from a
Rama09 [41]

Answer:

A hot spot

Explanation:

Q:

The range of an area where users can access the Internet via high frequency radio signals transmitting an Internet signal from a wireless router is known as a _____. A) HotspotB) PAN…

A:

A) hotspot Bluetooth is for short distance and pan is Personal area networks (PANs) connect an individual's personal devices

4 0
2 years ago
The full meaning of ENIAC,ABACUS,EDVAC,EDSAC<br>and explain ​
balandron [24]

Answer:

ENIAC: Electronic Numerical Integrator and Computer.

ABACUS: Abundant Beads, Addition and Calculation Utility System.

EDVAC: Electronic Discrete Variable Automatic Computer

EDSAC: Electronic Delay Storage Automatic Computer

7 0
3 years ago
You are assigned by your teacher to perform the assembly of all the parts of the computer in preparation for the hands on activi
Alexus [3.1K]

Answer:

answer it yourself or ask your teacker

Explanation:

7 0
2 years ago
Other questions:
  • What need most led to the creation of the Advanced Research Projects Agency Network? DARPA wanted scientists to be able to colla
    10·2 answers
  • What is cyber stalking and how does it work?
    7·2 answers
  • Is this statement true or false?
    12·2 answers
  • Vitamins and minerals dissolve easily in water.True or false?
    5·1 answer
  • What does psychologist Edward Spector mean when he says “ We have an entire generation of guinea pigs in an experiment”?
    14·1 answer
  • Which hexadecimal-type address refers to a physical networking device such as a network interface card?
    10·1 answer
  • You work as an IT Technician for uCertify Inc. David, a user, has recently purchased a laptop computer. He is now complaining th
    14·1 answer
  • Why was Apple the best company of 2019??
    15·2 answers
  • c724 wgu True or false. A storage device consists of all the components that work together to process data into useful informati
    10·1 answer
  • Write an algorithm to show whether a given number is even or odd.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!