Write a java program to simulate a pick lottery drawing

Assignment Help JAVA Programming
Reference no: EM131104827

Write a Java program to simulate a pick 3, 4 or 5 lottery drawing. A lottery game of this type will draw values between 0 and 9. You should use the Math.Random() or the java.util.Random() class to generate the values in the lottery drawing. The program should prompt the user for which lottery game they want to play (pick 3 or pick 4 or pick 5). The program should also ask how many times they want to play the game. The output should show the numbers picked for each game and it should sum each individual number selected into a total of all numbers. For example, if a user of the program made a selection to randomly draw 2 three digit numbers (as in the example shown below) the sum would be 3 + 5 + 0 + 1 + 0 + 0 = 9. Here is an example of what a run of your code should produce.

Do you wish to make lottery game selections? Y or y for yes, N or n for no

Input from keyboard - Y

Which lottery game do you want to play (Enter 3 for pick-3, 4 for pick-4, 5 for pick-5)

Input from keyboard - 3

How many games would you like to play?

Input from keyboard - 2

Thank you! The numbers randomly generated were:

350

100

The sum of each individually selected number is 9

Reference no: EM131104827

Questions Cloud

What is its daily transfer payment to other business unit : What is its daily transfer payment to the other business unit? (Quality) Consider the following potential quality problems: Wine that is served in a restaurant sometimes is served too warm, while at other times it is served too cold.
Provide examples of organizations : Illustrate with actual examples of employers achieving this balance. Also, provide examples of organizations failing to achieve one or both and illustrate what might result. Talking about external competitiveness with inter equity.
Question regarding private-sector employees : 1. How do public-sector employees' rights and interests differ from those of private-sector employees?
How would you expect the earnings of a growing exploration : How would you expect the earnings of a growing exploration company using full-cost-pool to differ from one using successful efforts accounting?
Write a java program to simulate a pick lottery drawing : Write a Java program to simulate a pick 3, 4 or 5 lottery drawing. A lottery game of this type will draw values between 0 and 9. You should use the Math.Random() or the java.util.Random() class to generate the values in the lottery drawing
Evaluate the companys overall liquidity and profitability : Calculate Apple Inc.'s working capital, current ratio, and acid-test ratio at September 27, 2008, and September 29, 2007. Evaluate the company's overall liquidity and profitability.
Calculate the price that gives maximum weekly revenue : The weekly sales of Honolulu Red Oranges is given by q = 1116 − 18p. Calculate the price elasticity of demand when the price is $31 per orange (yes, $31 per orange†). calculate the price that gives a maximum weekly revenue. $ Find this maximum revenu..
Describe unethical behavior in a company : Describe unethical behavior in a company regarding practices such as hiring, recruitment, discrimination, harassment, promotions, bookkeeping, etc. that either you or someone you know experienced.
Obtain monthly forecasts of the sales of a certain product : You are using exponential smoothing to obtain monthly forecasts of the sales of a certain product. The forecast for last month was 2,083, and then the actual sales turned out to be 1,973. Obtain the forecast for next month for each of the followin..

Reviews

Write a Review

JAVA Programming Questions & Answers

  Purchasing type of mobile device

Mobile devices use touch screens to interact with the individual. Select a mobile device and identify three (3) important usability features that are important to you when purchasing this type of mobile device. Provide a rationale for your respons..

  Describe the usefulness of the jframe class

What is a JFrame? Describe the usefulness of the JFrame class

  Develop java code to compute monthly rent for housing units

Develop a java code that computes monthly rent for 3 housing units namely Bungalows,Apartments and hostels. All housing units have got size,color and monthly rental rate.

  Your task for this project is to design a program to help a

your task for this project is to design a program to help a videorental store operatorrecord clients transactions.nbsp

  Determine which of a set of integers are prime numbers

Describes the trial division algorithm as Given an integer n, the integer to be factored, trial division consists of systematically testing whether n is divisible by any smaller number.

  What is the full path the to location of the web application

suppose that you are creating a java web application named "cset-test" consisting of a JSP file named "main.jsp" , and a java Servlet in a file named "InfoServlet.java". The user's home directory is /home/jdoe.

  Design a payroll class with the fields

Write a constructor that initializes these fields as well as accessor and mutator methods - Demonstrate the class in a program that contains a Car object, and then calls the accelerate method five times.

  Design an application to take and process a pizza order

Design an application to take and process a pizza order. The user should be able to make pizza order choices from list boxes, and the application should display the order price.

  Prompts the user to input a decimal number

Write a program that prompts the user to input a decimal number and ouputs the number rounded to the nearest integer.

  Attractive design and adequate content

One way to review a presentation and assess whether slides have an attractive design and adequate content is to switch back and forth between Slide Sorter view and Normal view.

  Java application-tests random number generation abilities

Write a Java application which tests the random number generation abilities of Java. Random number generation is explained below.

  What value is assigned to the variable phrase

Create a class State with five properties to hold the information about a single state and a method that calculates the density (people per square mile) of the state.

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