Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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

 

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9885477

Have any Question?


Related Questions in Computer Engineering

Configuring name resolutionas the administrator of the

Configuring Name Resolution As the administrator of the Contoso Corporation, you manage an internal website that is often used by most users with the company. You try to connect to an internal website but cannot open the ...

What are some examples of when a data compression utility

What are some examples of when a data compression utility can be used for information stored on a computer's hard drive?

Can you give me short cut of using excel word access share

Can you give me short cut of using excel, word, access, share point, and powerpoint microsoft, I am always have to rely on the back and forth, fleepng the pages, it is possible

Given two eventsnbspgnbspandnbsph the probabilities of

Given two events  G  and  H , the probabilities of each occurring are as follows: P( G ) = 0.22; P( H ) = 0.34; P( H  AND  G ) = 0.09. Using this information: Find the complement of P ( H  AND  G ). Round to 2 places.

A sequence of natural numbers a1 a2 an is said to be a

A sequence of natural numbers (a 1 , a 2 , ..., a n ) is said to be a degree sequence if there exists an undirected graph on n vertices {v 1 , v 2 , ..., v n } such that the degree of v i  is a i  for each i = 1, 2, ..., ...

1 investment risk and default risk are interchangeable

1. Investment risk and default risk are interchangeable terms and essentially mean the same thing.   2. Disadvantages of the Capital Asset Pricing Model include that you are using the past to predict the future and that ...

Ellen is an anthropologist who has been working at olduvai

Ellen is an anthropologist who has been working at Olduvai Gorge in Tanzania for the past six months. She has been conducting research on the Internet. She finds a Web site with an article that proposes a revolutionary t ...

Has globalizationnbspincreased or decreased social and

Has globalization increased or decreased social and economic disparities around the globe? Can you please provide details.

Searching algorithm - which to use for this problemthe

Searching Algorithm - Which to use for this problem? The original problem was: You get a job with a small e-commerce company. b) The customer base has grown to 8,000,000 customers. Jorge now insists that the sorting algo ...

Suppose you have the new zarnex vq-120 computer which has a

Suppose you have the new Zarnex VQ-120 computer which has a 64-bit architecture. Further, the boss has told you to ‘‘max out the memory,'' which, on that machine, means you can install all the memory the architecture sup ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As