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

Application-cybercrime-related laws and digital evidence

Imagine you are watching a movie that has a dramatic court scene where the prosecutor picks up a menacing weapon used in the commission of the crime. As he or she thrusts it

Find out the organizational behavior

Colin Powell is a retired four star general and was Commander of the United States Army Forces Command.  He also served as Secretary of State under George W. Bush and was hi

Reflects the appliance modules

Using Microsoft Word, Microsoft PowerPoint, or Microsoft Visio, create a hierarchy chart that reflects the appliance's modules and how the modules call each other. Keep in m

Identify penetrations and hurdle the point-in-time

Determine the types of monitoring that could be implemented to help quickly identify penetrations and hurdle the "point-in-time" security protections that regulations, such

Which of them is the appropriate function prototype

The function multiplies the contents of the old Price variable by 1.1 and then stores the result in the new Price variable. Which of the following is the appropriate functio

List five different applications of wireless lans

What are the main elements of wireless networks? What is the fastest wireless network and what is the slowest? Which wireless networks go the farthest and which ones are desig

Determine the least coefficient of static friction

The tongs are used to lift the 150-kg crate, whose center of mass is at G. Determine the least coefficient of static friction at the pivot blocks so that the crate can be li

Bandwidth of a telephone transmission facility

1. Given an amplifier with an effective noise temperature of 10,000 K and a 10- MHz bandwidth, what thermal noise level, in dBW, may we expect at its output? 2. What is the

Reviews

Write a Review

 
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