Write a basic java program called that simulates a lottery

Assignment Help Basic Computer Science
Reference no: EM13306156

Write a basic java program called that simulates a lottery.
Your program will generate a 5-digit lottery number, and then it will prompt the user to enter a guess in the form of a 5-digit number. Your program should then determine how many numbers the user guessed correctly and the user's prize. Your program must use an object of the Random class to generate five integers in the range 0 through 9 and must store these integers in an array.Your program also needs to prompt the user to enter 5 integers in the range 0 through 9 and then needs to store these integers in an array. So you will use two integer arrays in this program.To determine how many numbers the user correctly guessed, your program needs to compare corresponding elements of both arrays in a for loop. Use a counter variable to keep track of how many numbers the user guessed correctly. At the end of the program, output to the user the lottery number, the user's guess, and the number of that the user guessed correctly.Finally, your program needs to determine and display the user's prize. Here is a chart that defines the prizes for this lottery:

Number of

correct digits              Prize
0                                $0
1                                $10
2                               $100
3                                $1,000
4                                $10,000
5                               $100,000

 

Reference no: EM13306156

Questions Cloud

Create a monospaced font of point size : How would you create a Monospaced font of point size 20 that is bold? Give the Java statement needed.
What is the force produced at the tip of the needle : A syringe has an area of 1.5 cm2 at its barrel and then narrows down to an area of 0.11 mm2 at the needle end. what is the force produced at the tip of the needle
Give the java statement needed : How do you specify that the color orange will be used as fill when using the Graphics class? Give the Java statement needed.
Determine the hydraulic conductivity of the aquifer : Drawdown at a 0.20 m diameter, fully penetrating well, which has been pumping at the rate of 1000 m^3/day for a long enough time that steady state conditions have been reached, is determined to be 0.70 m.
Write a basic java program called that simulates a lottery : Your program will generate a 5-digit lottery number, and then it will prompt the user to enter a guess in the form of a 5-digit number. Your program should then determine how many numbers.
Determine the quantity of sludge wasted daily : An activated sludge system operates at a flow rate (Q) of 400 m3/day with an incoming BOD (So) of 300 mg/L. Throughout pilot plant work, the kinetic constants for this system are determined to be Y = 0.5 kg SS/kg
Calculate the minimum height of the water level in the tower : The water system in a town is designed by a careless engineer. He places the new water tower at the top of an extremely tall hill, Calculate the minimum height of the water level in the tower
Continental europe maybe germany.what industry should they : Mobile Square (text-message campaigning) is a customer-relationship-management platform. They service via text messages specific demographics, making donations by clicking on Web links.
Use string manipulations to figure out the units : Prompt the user two STRING inputs of time instances in the format of: YYYY/MM/DD HH:NN:SS. Use string manipulations to figure out the units (year, minute, etc.). The output is the total elapsed time in seconds between the two time inputs.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Public boolean chackanagram

write the anagramList() chackanagram. checkAnagram returns true if its two Word parameters have original words that are nagrams. If not, checkAnagram returns false. use the ethod header below to write checkanagram. Assume that all Word methods work a..

  Write a flowchart with single alternative decision structure

Write a flowchart with a single alternative decision structure that assigns 0 to the variable b and assigns 1 to the variable c it the variable a is less than 10

  Write a mips program to complete the following functions

Write a MIPS program to complete the following functions. You must write comments and follow the register convention. [30 points] (1) Declare an integer array of 20 elements and other variables and labels; [5]

  Use the matlab function spline to evaluate the natural cubic

Use the Matlab function spline to evaluate the natural cubic spline that interpolates the data points stored in the arrays x,y at on the points of the ner grid xx. (b) Plot the results of part (a).

  Map elements can placed anywhere within body the web page

Map elements can be placed anywhere within the body of the Web page because they are not actually displayed by the browser, but used as references for mapping ____ to inline images.

  What are the main disadvantages of hypermedia

What are the main disadvantages of hypermedia when compared with conventional media such as books and videos?

  Write a program that reads a list of numbers

write a program that reads a list of numbers, counts them, and calculates their arithmetic mean, geometric mean, and harmonic mean. These values should be printed with appropriate labels.

  Explaining difficulties in managing information resources

Considering difficulties in managing information resources, explain in scholarly detail why risk management must involve in the following elements to include threats,

  Prove by solving the equations using laplace transform

For a RC circuit, we can use Laplace transforms to show that when we apply a step input of 5V, the voltage across the capacitor rises exponentially to a final value equal to step input.

  Describe the effect of an organization strategic planning

Describe the effect of an organization's strategic planning on the IT systems it uses. Address how strategic planning simplifies and complicates IT system development and use. This only has to be 200 words.

  Write structured english for clyde-s narrative policies

Lasting more than one day, we permit hotel, taxi, and airfare, also meal allowances. Same times apply for meal expenses." Write down structured English for Clyde's narrative of reimbursement policies.

  Using the expand, guess, and verify method find closed

Using the expand, guess, and verify method find closed form solutions for the following recurrence relations.

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