Write a java program to simulate a die

Assignment Help JAVA Programming
Reference no: EM13762882

1. Write a Java program to simulate a die. A die has values of either 1, 2, 3, 4, 5 or 6 on the face. You should use the Math.Random() or the java.util.Random() class to generate the values on the die. The program should prompt the user to enter how many times the die should be rolled. The output should show the results of each roll along with the total number of times 1, 2, 3, 4, 5 or 6 occurred for all rolls and the total sum comprised of the sum of all rolls. Here is a sample run:

How many times do you want to roll the die? 10

Thank you! The die roll results for 10 rolls were:
2
3
4
5
3
2
6
2
1
6

The number of occurrences of each face were as follows

1: 1
2: 3
3: 2
4: 1
5: 1
6: 2

The sum of die rolls was: 34

Reference no: EM13762882

Questions Cloud

Research question and testable hypothesis : State the research question and testable hypothesis. Interpret, discuss, and support your findings with at least two other classmates.
Calculate the beta and standard deviation of stock : Consider the following information on Stocks I and II: State of Economy Probability of State of Economy Rate of Return if State Occurs Stock I Stock II Recession .24 .030 ?.34 Normal .59 .340 .26 Irrational exuberance .17 .200 .44 The market risk pre..
Processing-document preparation-administration-underwriting : A person was considering buying a house priced at $300,000. A mortgage company claimed the interest rate for the 20 year loan is 3.75%. What would the monthly payment, if the person decided to borrow 90% of the cost of the house and 100% of the proce..
Assignment on job-order costing system : Should EEC use a job-order costing system, which is a costing system where costs are collected and assigned to units of production for each individual job, or a process costing system, which is a costing system that accumulates production costs by p..
Write a java program to simulate a die : Write a Java program to simulate a die. A die has values of either 1, 2, 3, 4, 5 or 6 on the face. You should use the Math.Random() or the java.util.Random() class to generate the values on the die. The program should prompt the user to enter how ..
What is the intrinsic value of this stock : Store Age Inc. recently paid its annual dividend ($1.00), and reported an ROE of 15%, of which 50% is paid as dividends. The stock has a beta of 1.00. The current risk-free rate is 2.10% and the market risk premium (RM - RF) is 9.00%. Assuming that C..
Cost of operation exercise : Toy Box, Inc., is contemplating expanding sales of their children's toys. The have an opportunity to stock and sell the X toy that has been a big hit with children everywhere.
How can investors deal with different degrees of risk : Why are investors risk-averse? How can investors deal with different degrees of risk? What is the expected return on a portfolio? How can the expected return on a portfolio be manipulated to minimize the risk on that portfolio? What is the beta coeff..
Charity judaisms view of philanthropy by jacob neusner : Righteousness, not charity judaisms view of philanthropy by Jacob Neusner - systems and ecological theories to explore this co-existenc.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd