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]
4 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:
hjlf4 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
What file would you edit to restrict the number of simultaneous logins a user can employ??
Vlada [557]
Your answer is:
C. /etc/security/limits.conf

I hope this helps! :)
8 0
3 years ago
Which button could Pamela press in the Microsoft Word spell checker to make the word “colour” instantly change to “color” whenev
Norma-Jean [14]
She could right click her mouse to select the correct word to add it into her dictionary.
5 0
3 years ago
Which of the following are examples of software? Check all of the boxes that apply.
dezoksy [38]

Hey!

------------------------------------------

<h3>Answers:</h3>

Operating System

Web Browser

Word Processor

Device Driver

------------------------------------------

<h3>Explanation:</h3>

Software is a set of data that tells the computer what to do. Each of the answer above tell the computer something specific to do.

The operating system are basic functions that make the computer run smoothly.

The web browser is telling the computer you want to look something up like in internet explorer, firefox, and chrome.

The word processor is a piece of software that tells the computer that you want to format a piece of text like in Microsoft word.

The device driver is a piece of software that controls a connected device like a phone or another computer.

------------------------------------------

Hope This Helped! Good Luck!

4 0
3 years ago
Read 2 more answers
NumA=2<br> for count range (5,8)<br> numA=numA+count <br> print(numA)
love history [14]

Answer:

for count in range (5,8): numA=numA+count print(numA)

Explanation:

7 0
3 years ago
Why are there more producers then consumers?​
Ivanshal [37]

Answer:

because producer can make their own food

6 0
3 years ago
Read 2 more answers
Other questions:
  • Which activity constitutes legal computer activity?
    12·1 answer
  • A network engineer arrives at work and discovers that many users are having problems when attempting to connect to the company n
    9·2 answers
  • While in an interactive nslookup session, you'd use the ______ keyword to change the DNS server you're using
    5·2 answers
  • Another html/css assignment, drop css code below, thank you
    15·1 answer
  • Many people keep time using a 24 hour clock (11 is 11am and 23 is 11pm, 0 is midnight). If it is currently 13 and you set your a
    10·1 answer
  • If Tracy starts on the left edge of the canvas and moves forward 50 pixels, how many times will this code need to be repeated to
    5·1 answer
  • The process of adding a header to the data inherited from the layer above is called what option below
    8·1 answer
  • What is project scope? a. Quantifiable criteria that must be met for the project to be considered a success b. Products, service
    5·1 answer
  • Which descriptions offer examples of Correction Services workers? Select all that apply.
    8·1 answer
  • Type the correct answer in the box
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!