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

  What is an example of a javascript framework

What is an example of a JavaScript(r) framework? In the framework you have described, what is an example of an application that would work well on the site you are building for the class? What is the purpose of the application and how will it enha..

  Java program which demonstrates cellular automata

Using the internet, locate a Java program (or Java applet) which demonstrates "Cellular Automata", in particular "the Game of Life".

  Declare another television object called portable

Add to the comment header as indicated at the top of the program.

  Create the look for two gui applications

Create the look for two GUI applications. You WILL NOT be getting the applications to do anything. We are only interested in seeing how well you can arrange the GUI components onto the window

  What are differences between instance and class variables

What are the differences between instance and class variables? What is an overloaded method?

  Java program to write-read data from user using i-o function

Write java program to write and read data from user using I/O functions. Describe class with data members name[20],emp_id,basic pay,net pay.calculate all the allowances.

  How to read data in a link list

How to read data in a link list?

  Write a complete program which computes the sum

Write a complete program (actually complete the one on the exam) which computes the following sum: ( 100 / 1 ) + ( 99 / 2 ) + ( 98 / 3 ) + ( 97 / 4 ) + ... + ( 3 / 98 ) + ( 2 / 99 ) + ( 1 / 100 ) Use a FOR loop in your program (where indicated) to..

  Write a java program to accept a day number

Write a Java program to accept a day number from the user and display the corresponding day name by using the if/else construct. Rewrite the program using the switch case construct

  Program that asks how many automobiles are to be described

Write a program that asks the user how many automobiles are to be described, and for each automobile it inputs the user's selection of make and color.

  How are java source code files named

What is the purpose of the wait(), notify(), and notifyAll() methods? How are Java source code files named?

  Die class that can hold an integer

Design a die class that can hold an integer from 1 to 6. use the dice class to create a dice game. in this game, the user chooses a number between 2 and 12 inclusive

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