Create a java Program,In this question you are asked to write a lottery game application. Your program must first display a welcome message/banner asking the human player for his/her given name.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Create the following program in java:

Create a java Program,In this question you are asked to write a lottery game application. Your program must first display a welcome message/banner asking the human player for his/her given name.

 

Generate a random number between 0 and 999, which you are to store in a single variable (int). Allow the user to guess a three digit number between 0 and 999, which you are also to store in a single variable of type int.

 

Compare the user’s guess to the random number and display a message that includes the user’s name, user’s guess, the randomly determined three-digit number and the amount of money the user has won as follows:
         Matching digits                       Awards

         Any one matching.                    $10

           Two matching.                          $100

  Three matching not in order.           $1000

Three matching in exact order.     $1,000,000

No matches.                                        $0

Make sure that your application accommodates repeated digits. For example if a user guesses 123 and the randomly generated number is 111, do not give the user credit for three correct guesses – just one. On the other hand if the user guesses 121 the user gets credit for 2 correct guesses. Note that the 3 digitnumber can start with a 0 or even 2 zeroes. When displaying these numbers be sure to include the zeroes in the front.

Sample output:

********* welcome to lottery game******
what is your name

Annna

welcome Annna

Enter a three digit number followed by enter key

123

The lotto number was 897

The number u gave was 123

There have been no matches u win $0

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 5 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY