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
What is the value of n so that the expression x^2 + 12x + n is a perfect square trinomial? (1 point)?
Rama09 [41]
X^2 + 12x + n
x^2 + 12x + (12/2)^2
x^2 + 12x + 6^2
n = 36
(x + 6)^2 will give you a perfect square.
6 0
4 years ago
In a certain region, there is a 0.1 probability that any checked passerine bird's nest will
mamaluj [8]

Answer:

Probability of at least two cuckoo eggs is 0.738.

Step-by-step explanation:

probability of cuckoo egg = 0.1

probability of not a cuckoo egg = 1 - 0.1 = 0.9

Probability of at least two cuckoo eggs is

= Probability of two cuckoo eggs x probability of 1 not cuckoo egg +

probability of three cuckoo eggs

= 0.1 x 0.1 x 0.9 + 0.9 x 0.9 x 0.9

= 0.009 + 0.729

= 0.738  

5 0
3 years ago
Attachment mathswatch!!!!!!!!!!!!!
SSSSS [86.1K]

Answer:

a) = Slope of line AB = 1/2

<h2><em><u>Perpendicular = -2</u></em></h2>

<h2>b) <em><u>y = -2x + 6</u></em></h2><h2 />

Step-by-step explanation:

a) When it is perpendicular the answer will be positive if the initial value is negative. If it is a whole number, then the perpendicular number is going to be a fraction. The opposite applies.

b) Slope = -2x

   intercept = ?

y = -2x + b

0 = -6 + b

+6  +6

b = 6

<em><u>y = -2x + 6</u></em>

7 0
3 years ago
Read 2 more answers
You are attempting to make a scale drawing of your room. The actual size of your room is 12 feet
olga2289 [7]

Answer:

width = 8 inches

length = 10 inches

Step-by-step explanation:

width= 12/1.5

= 8

length = 15/1.5

= 10

6 0
4 years ago
Use the arithmetic progression formula to find the sum of integers from 75 to 100.75,76,77....99,100.​
Sophie [7]

Answer:

The sum is 2275

Step-by-step explanation:

Given

75,76,77....99,100

Required

The sum

Using arithmetic progression, we have:

S_n = \frac{n}{2}(T_1 + T_n)

Where:

T_1 = 75 --- first term

T_n = 100 --- last term

n = T_n - T_1 + 1

n = 100 - 75 + 1 = 26

So, we have:

S_n = \frac{n}{2}(T_1 + T_n)

S_n = \frac{26}{2}*(75 + 100)

S_n = 13*175

S_n = 2275

5 0
3 years ago
Other questions:
  • How to find overall range
    10·1 answer
  • Is 4 tons greater than 7,000
    5·2 answers
  • Identify a reflection about the x-axis or a reflection about the y-axis of ƒ(x) = 7x2 – x3 by observing the equation of the func
    13·1 answer
  • Can someone please help me with 1 and 2 :)
    9·1 answer
  • En el acuario donde trabaja Alexandra, han requerido 4627 peces para distribuirlos en 21 peceras ¿cuantos peces se deben colocar
    5·1 answer
  • Choose the correct discriminant, then
    14·1 answer
  • Cherry bought two cupcakes and got $13 back Sonia bar for cupcakes and got six dollars back in the each pay with the same amount
    9·1 answer
  • Help me please!!!!!!!!!!!!!!!!!!!
    9·2 answers
  • Andrea earned 200 points on a school assignment. Because the
    6·1 answer
  • The 6% state<br> income tax<br> on a $72,000<br> salary
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!