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
Wewaii [24]
4 years ago
13

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

body: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.

Mathematics
1 answer:
vampirchik [111]4 years ago
5 0

Answer:

Step-by-step 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
4.4 The three circles are fitted into a rectangle like in the figure below. The radius of the bigger Is 5 unit and the radius of
statuscvo [17]

The height of the parallelogram is 6.4 m.

<h3>What is a parallelogram?</h3>

A parallelogram is a quadrilateral. Let us recall that a quadrilateral is a four sided figure. It is also important to recall that the opposite sides of a parallelogram are equal.

Let us now try to find the height of the parallelogram;

Given that;

/DE/ = /AC/

10 = /BC/ + /AB/

/AB/ = 10 -  /BC/

/AB/ = 10 - 6

/AB/ = 4 cm

Then;

/AE/= /CD/ = 5 cm

Using the Pythagoras theorem;

/EB/^2 = /AE/^2 + /AB/^2

/EB/ = √/AE/^2 + /AB/^2

/EB/ = √(5)^2 + (4)^2

/EB/ = √ 25 + 16

/EB/ = 6.4 m

Learn more about parallelogram:brainly.com/question/1563728

#SPJ1

8 0
2 years ago
In election to choose a student representative it was found that 2/15 (fraction ) of the students voted for Omar, 3/5 voted for
Tomtit [17]
Okay so Omar had 2/15 of the votes and Scott had 3/5 which will go up to 9/15 before it was reduced down so 9 plus 2 is 11 so 15 minus 11 is 4 so Lindsey got 4/15 of the votes.
4 0
4 years ago
Read 2 more answers
I’m I right? If not change it for me
dangina [55]

The first and third are correct. They are equal.

The second is incorrect. This is because 1800 meters = 1.8 km (not 18 km). The answer you should have is a "less than sign" because 1.8 km is smaller than 18 km.

To go from meters to kilometers, you move the decimal point 3 spots to the left. This is the same as dividing by 1000.

To go from kilometers to meters, you move the decimal point 3 spots to the right. This is the same as multiplying by 1000.

8 0
3 years ago
Read 2 more answers
What is the answer?
Andrej [43]

Answer:

A I believe?

Step-by-step explanation:

8 0
3 years ago
Read 2 more answers
According to one economic model, the demand for gasoline is a linear function of price. If the price of gasoline is p # $3.10 pe
Agata [3.3K]
Your first line calculation is already true but reversed. The demand will decrease (that mean the formula would be minus) by 20 gallons for every $0.4 price increase, which means 50 gallons/$. To find the formula you need to insert one sample of either the first equation (65gallon and $3.1) or 2nd equation (45 gallons and $3.5). The formula for demand should be:

q= C - 50p
65 gallon= C- 3.1 * 50 
C= 65 gallon + 155 gallon= 220 gallon

The formula would be:
q= 220- 50p

So the second question can be solved by putting 0 on the Q. It would be:
q= 220- 50p
0=220-50p
50p=220
p= $4.4
6 0
4 years ago
Other questions:
  • Can the triangles be proven similar using the sss or sas similarity theorems? yes, △efg ~ △klm only by sss. yes, △efg ~ △klm onl
    13·2 answers
  • How far can a person run in 15 minutes if he or she runs at an average speed of 16 km/hr? (Convert minutes into hours)
    8·2 answers
  • X-(-15)=11 what is x
    13·1 answer
  • What is the property of 7/9 * 1 = 7/9
    10·1 answer
  • You have 30 sandwich and 42 granola bars basket what is the greatest number of picnic basket you can make
    7·1 answer
  • John and Pam are paid 38.25 for their work. John worked 1.5 hours and Pam worked 3 hours. They split the money according to the
    9·2 answers
  • If N || P and P bisects M then _____ (13)
    7·1 answer
  • ( if you can’t see zoom in ) reflect across the y axis and match with the new coordinates please help i’ll give brainliest
    14·1 answer
  • Simplify.<br> multiple choice
    8·1 answer
  • On the coordinate plane shown below, points H and F have coordinates ( − 2 , − 3 ) and ( − 4 , 2 ) , respectively. Use the dista
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!