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

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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