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
Roman55 [17]
3 years ago
14

Select the correct answer.

Computers and Technology
1 answer:
zysi [14]3 years ago
8 0

Answer:

B

Explanation:

You might be interested in
1) Open the file DiceSimulation.java attached below. Create a new project on NetBeans called DiceSimulation. Copy the code from
trapecia [35]

Answer:

As per regulations, I can only answer the code in while loop.

Explanation:

Code in JAVA is given below for while loop

Please read all the comments for better understanding of the code.

Every step is explained well in the code.

Note class name is DiceSimulation.

Code in JAVA (Using while loop)::

import java.util.Random; // Needed for the Random class

/**

This class simulates rolling a pair of dice 10,000 times and counts the number of times doubles of are rolled for each different pair of doubles.

*/

public class DiceSimulation

{

public static void main(String[] args)

{

final int NUMBER = 10000; // Number of dice rolls

// A random number generator used in

// simulating the rolling of dice Random generator = new Random();

int die1Value; // Value of the first die

int die2Value; // Value of the second die

int count = 0; // Total number of dice rolls

int snakeEyes = 0; // Number of snake eyes rolls

int twos = 0; // Number of double two rolls

int threes = 0; // Number of double three rolls

int fours = 0; // Number of double four rolls

int fives = 0; // Number of double five rolls

int sixes = 0; // Number of double six rolls

// TASK #1 Enter your code for the algorithm here

/**

* Following while loop will run until count < Number.

*/

while(count<NUMBER){

/**

* To generate random number in range 1 to 6,

* I have declared two integer variables named min and max

* and initialized to 1 and 6 respectively.

*/

int min=1,max=6;

/**

* An object of Random class named rand is created so that we can generate

* random number.

*/

Random rand=new Random();

 

/**

* Using following formula we get random number in range 1 to 6.

* Both variables i.e die1Value and die2Value are initialized

* with the formula given in each iteration.

*/

die1Value = rand.nextInt((max - min) + 1) + min;

die2Value = rand.nextInt((max - min) + 1) + min;

 

/**

* Now we are interested in cases where there is double i.e

* Both random generated numbers in die1Value and die2Value are same.

*/

if(die1Value==die2Value){

/**

* Now there are 6 possibilities. They are shown in Nested IF-ELSE-IF statements.

* As both values are same, I have taken die1Value to check if it is 1,2,3,4,5 or 6.

*/

if(die1Value==1){

/**

* If die1Value is 1 then we increment snakeEyes by 1.

* Similarly for others too we do the same.

*/

snakeEyes++;

}else if(die1Value==2){

twos++;

}else if(die1Value==3){

threes++;

}else if(die1Value==4){

fours++;

}else if(die1Value==5){

fives++;

}else if(die1Value==6){

sixes++;

}

}

/**

* In each iteration we increment count by 1.

*/

count++;

}//While loop ends here.

// Display the results

System.out.println ("You rolled snake eyes " + snakeEyes + " out of " + count + " rolls.");

System.out.println ("You rolled double twos " + twos + " out of " + count + " rolls.");

System.out.println ("You rolled double threes " + threes + " out of " + count + " rolls.");

System.out.println ("You rolled double fours " + fours + " out of " + count + " rolls.");

System.out.println ("You rolled double fives " + fives + " out of " + count + " rolls.");

System.out.println ("You rolled double sixes " + sixes + " out of " + count + " rolls.");

 

}//main ends

}//class ends

4 0
3 years ago
Ron is creating building blocks in Word. How can he make the building blocks that he created available?
ivann1987 [24]

Answer:

you can store those building blocks in the Normal template

Explanation:

Building Blocks are different pieces of content such as tables, lists, headers, and text boxes that can be added and used for your word document. In order to make these available, you can store those building blocks in the Normal template. This will allow you to instantly and repeatedly access them for various different projects that you may be working on.

8 0
3 years ago
Read 2 more answers
Learning in a digital environment is also called learning.
aleksandrvk [35]

Learning in a digital environment is also called O<u>nline Learning.</u>

Explanation:

The main difference between the digital learning and the traditional form of learning is that

  • Digital Learning takes place online or virtually.
  • The traditional Learning is conducted in a classroom building.
  • Another factor that differentiate the 2 forms of learning is that the instructor or the trainer may not be present at the real-time but in a traditional training method the trainer or the instructor is present in person
6 0
4 years ago
Read 2 more answers
What is the first step you should take when you want to open a savings account?
pav-90 [236]
 First Go to the bank
Second Present Photo ID
 third Fill out application

I would think review the different savings account options that your bank offers...

Last Make initial deposit.



Hope that helps!!!

.
5 0
3 years ago
Alicia uses a software application to store the names, email addresses, and phone numbers of her friends in alphabetical order. 
Romashka-Z-Leto [24]

I'm not 100% sure but I think it might be Microsoft excel.... correct me if I'm wrong

7 0
3 years ago
Read 2 more answers
Other questions:
  • Write a Java program to accept an item's name and price from the user and output them to the console
    5·1 answer
  • Some languages are traditional programming languages for developing applications; others, such as markup and scripting languages
    12·1 answer
  • Write an expression that computes the average of the values 12 and 40.
    6·1 answer
  • 1. Give one reason why data is represented in binary in a computer
    15·1 answer
  • Companies expose themselves to harsh sanctions by federal agencies when they violate the privacy policies that their customers r
    8·1 answer
  • The use of computer in a modern world is as a result of complexity. true or false
    6·1 answer
  • USE THIS CODE ON FETCH REWARDS FOR BRAINLIEST​
    10·1 answer
  • Which federal legislation prohibits credit card companies from raising rates on existing balances?
    10·2 answers
  • Networks, partnerships, and joint ventures are an example of
    7·1 answer
  • Enthusiasm codehs 7.6.4 Write a function called add_enthusiasm that takes a string and returns that string in all uppercase with
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!