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

  Prepare a basic code to do the followingwrite a program

prepare a basic code to do the following.write a program that shows the current time and date evaluated from the

  Create your listarray class

Create your ListArray class that is functionally similar to the formal Java ArrayList Utility class. here are the requirements

  Minimal spanning tree decreasing edge

minimal spanning tree decreasing edge dismissalreverse-delete algorithm. develop an implementation that computes the

  Determines the surface area and volume of a hemisphere

Write an application that reads determines the surface area and volume of a hemisphere and then calculates the radius given a surface area and volume.The first step is to read in the radius from the users and then calculate the surface area and vo..

  Ticketmaster

TICKETMASTER - this class will have: a service charge = $8.00 per ticket, tax = .085 current amount of all tickets sold. Its responsibilities are printing a list of events for sale, looking up an event for a customer, and selling a ticket to the e..

  What makes a program easy to modify

Describe the order of magnitude of the code section using Big(O) notation and Explain the relationship between dynamic storage allocation and recursion.

  How many numbers do you want to enter

Write a program that asks the user "How many numbers do you want to enter?" With that value, create an array that is big enough to hold that amount of numbers (integers).

  Java program the program has a page that shows the users

java program the program has a page that shows the users name and program name. a second jpanel that shows 4 buttons

  Use data structures and algorithm to implement search engine

For the URLs in the keyword list, sort them by either the number of times the keyword appearing in the pages or the popularity of the pages.

  The ai player will not be asking

The AI player will not be asking the user for any input. This means that placeShips() and fire() should not ask the user for locations. The AI player should choose locations of ships and automatically place them

  Program that uses random instead of scanner to play

Write a Java Program that uses Random instead of Scanner to play many rounds of Rock Paper Scissors. The user and computer will each randomly pick one and common rules of winning apply

  Explain how a typical ide is used explain the purpose of

explain how a typical ide is used. explain the purpose of the various panes of the ide. justify the importance of this.

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