Question: Get Create a class name Lottery with a main method. Create the following variables: lottery (int) and initialize it to 57 : The number that

 Get Create a class name Lottery with a main method. Create

Get Create a class name Lottery with a main method. Create the following variables: lottery (int) and initialize it to 57 : The number that a player needs to guess guess (int) and initialize it to 27: The number that a player will insert Print the lottery number. . If the guessed number (guess) is equal to the lottery number (lottery), print a message that the player wins $10,000. . If all the digits of the guessed number (guess) match the digits of the lottery number (lottery) (not in the same order), prints a message that the player wins $3,000. If one of the digits of the guessed number (guess) matches one digit of the lottery number (lottery), prints a message that the player wins $1,000. . Else print a message that the digits did not match. Assume that the game only accepts a two digits positive number. The digit may be 0. If the number is less than 10, assume that the number is preceded by a 0 to form a two-digits number. For example, 6 is treated as 06 and O is treated as 00

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!