Question: Exercise 2 Write a java program that to help the Lebanese scout to create an online tombola ( lottery ) . Your program should generate
Exercise
Write a java program that to help the Lebanese scout to create an online tombola lottery Your program should generate a random number between and using Math.random Your program should then ask the user to enter numbers to and then compare the numbers entered with the randomly generated number. If the numbers match the generated digits number in the same order, your program outputs "Congratulations, You won the tombola". The user is allowed to repeat his guess for times maximum,
Sample run:
Enter digits
You can try for times
Enter digits
You can try for times
Enter digits
You can try for times
Enter digits
Congratulations, You Won
Sample run:
Enter digits
You can try for times
Enter digits
You can try for times
Enter digits
You can try for times
Enter digits
You can try for times
Enter digits
You can try for times
Enter digits
You can try for times
Enter digits
You can try for times
Enter digits
You can try for times
Enter digits
You can try for times
Enter digits
You can try for times
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
