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
Photographing during the midday can produce which of the following?
deff fn [24]
It can produce harsh shadows
5 0
2 years ago
Read 2 more answers
Explain an application software​
dedylja [7]

Answer:

application software refers to the programs or series of instructions that allows us to do specific type of task on a personal computer examples word processing programs, spreadsheet programs, presentation programs among others

6 0
2 years ago
PLZ HELP!!!
mariarad [96]
Answer: A. Usability testing
Explanation:
Usability testing would be the correct answer because if the user interface isn't "frendly" then people won't be able to use it properly. Or if you are refering to the word friendly as looking safe, then even more so would be usability testing. Because if people don't like the fonts and styles of the user interface, they might not use it at all.
8 0
2 years ago
Siltstone is made mostly of _____.<br><br> A : silt<br> B : sand<br> C : shells<br> D : gravel
frez [133]
The best and most correct answer among the choices provided by the question is the second choice. <span>Siltstone is made mostly of silt. </span>I hope my answer has come to your help. God bless and have a nice day ahead!
6 0
3 years ago
Read 2 more answers
How do cameras work? Explain in 2-3 sentences.
FinnZ [79.3K]

Answer:

In a digital camera, exactly the opposite happens. Light from the thing you are photographing zooms into the camera lens. This incoming "picture" hits the image sensor chip, which breaks it up into millions of pixels. The sensor measures the color and brightness of each pixel and stores it as a number.

Explanation:

3 0
2 years ago
Other questions:
  • Transparency is an important concept in policies related to the handling and use of customer data. Organizations should be trans
    5·1 answer
  • Troubleshooting comes before diagnosing. Answer: false
    7·1 answer
  • Write a program that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follo
    5·1 answer
  • When a Python program is reading a file, the data is input as plain ASCII characters in a string. What is the following code doi
    15·1 answer
  • To rename a database object, press and hold or right-click the object in the navigation pane and then tap or click ____ on the s
    10·1 answer
  • A packet analyzer is a program that can enable a hacker to do all of the following EXCEPT ________. Select one: A. assume your i
    6·1 answer
  • What can cause a Lenovo computer to be very slow right after after turning it on?
    14·1 answer
  • Hey system has defined specific Quetion that describe how signals are sent over connections. Which layer of the transmission con
    11·1 answer
  • Which company was the first to develop personal computers?
    6·1 answer
  • Who watches the show gravity falls, if you do, if you play the theme song for the first episode backwards you get a hiding messi
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!