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

  How will you run a process in background

How will you run a process in background? How will you bring that into foreground and how will you kill that process?

  What is the difference between cdma and lte

What is the difference between CDMA and LTE? Is one technology better than the other?

  Write recursive method prints out the digits reverse order

Write the code for a recursive method that accepts an integer argument and prints out the digits in reverse order

  Design a program that generates the sum of numbers

Design a program that generates the sum of numbers.

  Which domain local groups might you create

Habibi's has a small network of 20 client workstations and a Windows Server 2008. Seven of those workstations are inside the restaurant and are used by the table servers to place customer orders. Three of the workstations are used by the owner and th..

  Smallest exponent that can be stored using this 16 bit stand

storing number in a string of 16 bits, the first bit is used for the sign of the number, and the next 5 bits store the exponent plus the bias, and the remaining 10 bits store the mantissa.  The bias is 15. What is the smallest exponent that can be st..

  Describe areas where you see disagreement between authors

Include any information you believe adds to the material in the text. Describe any areas where you see disagreement between the two authors.

  Design of e-business applications

With that in mind, how do you think the Americans with Disabilities Act affects website design and design of E-business applications?

  Differentiate tv production-film and theatre production

How does TV production use technology. Is there a basic difference between TV production vis-a-vis film and theatre production?

  Write a program in c++ for a server

Write a program in C++ for a server (called math solver) which solves three math problems: factorial (i.e. n!), exponent with base 2 (i.e. 2n), and cube (i.e. n3).

  How many other machines is each machine equivalent to

Every Turing machine is equivalent to some other machine in our enumeration. Why? How many other machines is each machine equivalent to? How many times is each Turing-computable function represented in our enumeration? Be sure to justify your answ..

  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).

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