Question: no arrays please #1 Lottery program - 8 points Develop a Java program to play the lottery. The program will randomly generate a two-digit number
#1 Lottery program - 8 points Develop a Java program to play the lottery. The program will randomly generate a two-digit number to represent the lottery numbers (the lottery numbers are single-digit, generating a two-digit number makes this easier). The program will ask the user for a two-digit number. The program will determine if the user wins according to the following rules: 1. If the user matches the lottery numbers in exact order, the user wins $10,000 2. If the user matches both numbers, out of order, the user wins $3,000. 3. If the user matches one digit, the user wins $1,000. A sample run of this program might look like this (user input is in red): Enter your two-digit lottery numbers: 56 The lottery numbers were 25, you win $1,000. A second run of this program might look like this (user input is in red): Enter your two-digit lottery numbers: 56 The lottery numbers were 56, you win $10,000. A third run of this program might look like this (user input is in red): Enter your two-digit lottery numbers: 56 The lottery numbers were 12, you win $0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
