Question: Write a program in Java to determine a winning number which is generated by random function. The user enters a three digits number. Based on

Write a program in Java to determine a winning number which is generated by random function. The user enters a three digits number. Based on the logical calculation and selection structure it determines the first, second, third and no winners. The program must be complete with few examples of input and output. Must include all the phases. The first winning prize is 10000, the second is 5000 and the third one is 3000. Output the winning number with the result for the users to know

If the exact number is matched first prize, if any of the last two digits matched, the second prize , if any digit is matched the third prize. No match no winner.

Example

N loto

25 52

N %10 == loto/10 && N/ 10=== lot %10

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!