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
A program runs from start to finish, producing unexpected results, though no error message is received. What most likely occurre
adelina 88 [10]

Answer:

The answer is most likely B

Explanation:

If it is a logic error, then the computer thinks it is doing the correct task.

8 0
3 years ago
PACIFIC NORTHWEST
poizon [28]

Answer:

b) Tufts University Nutrition Web Page

Explanation:

The site that most likely provides a balanced information on eating a balanced diet is the Tufts University Nutrition Web Page

Tufts University is a moderate size, leading private research American higher education institution located in Massachusetts that offers degree programs on Food and Nutrition Policy and Programs

By comparison with the other sites which are;

a) Pork Producers Nutrition Page, which is expected to be related with pork production pork producers and pork consumers, based on the title focus, the information provided by the page is therefore, not meant for general use and therefore not meant to be balanced

c) The Eat What You Want Page, based on the of the page title literally which suggest the liberty for a user to eat what they want to eat does not appear to call for the input of an expert advice on nutrition, and therefore is not balanced.

8 0
3 years ago
Explain why there are fundamental ideas of software engineering that apply to all types of software systems.
olasank [31]

Solution:

Because of all software systems have common quality attributes, including  

Fundamental software engineering activities.  The four basic process activities of specification, development, validation and evolution are organized differently in different development processes.  The software is implemented either by developing a program or programs or by configuring an application system. Such that at they (Software engineer) have been made keeping in mind project development. They hence, apply to all software systems and even non software systems. They are the fundamentals for any kind of project development.

Thus this is the required answer..


5 0
3 years ago
Why is the len ( ) function useful when using a loop to iterate through a stack?
Marizza181 [45]

The len ( ) function will run with each iteration, printing the element number each time.

6 0
3 years ago
Certain files, such as the ____ and Security log in Windows, might lose essential network activity records if power is terminate
Hoochie [10]

Answer:

The answer to this question is a. Event log

Explanation:

Event log in Windows is a comprehensive record of security,system and application notifications stored by the Windows and it is used by administrators to determine problems in the system and foretell issues that going to happen in future.

Operating system and the Apps use event logs to keep account of important software and hardware activity that administrator can use to correct issues with the operating system.

7 0
3 years ago
Other questions:
  • April 107 90 29 31 66 0.344
    8·1 answer
  • Which of the following would an interactive media proffessional must likely need
    9·1 answer
  • Briefly describe "SoftwareEngineering Framework". Do provide examples and diagrams wherenecessary.
    15·1 answer
  • John works for Internal Computer Specialists, which focuses on helping small business owners resolve MIS infrastructure issues.
    12·1 answer
  • IBF Consultants, LLC provides consulting services in privacy and theft deterrence solutions. Another client has very sensitive d
    7·1 answer
  • For selection purposes, it is critical that application items have a proven relationship between a selection device and some rel
    5·1 answer
  • ______ is a disadvantage of EDI.
    8·1 answer
  • Name a piece of software you often use where it is easy to produce an error. Explain ways you could improve the interface to bet
    5·1 answer
  • Which letter would appear in the third position of the standard wheel marking of a hard-grade wheel?
    10·2 answers
  • Write a program to prompt the user for hours worked to compute a gross pay for an employee, and he is paid 100/hour. If he worke
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!