Question: Please dont use advanced Java concepts as this is a basic class Starting Code: /* Programmer: Date: Project: Lab 3.2 PickThreeLottery File Name: PickThreeLottery.java Program
/* Programmer:
Date:
Project: Lab 3.2 PickThreeLottery
File Name: PickThreeLottery.java
Program Description: Determine how long it takes to win a pick 3 lottery straight up.
*/
import java.util.*;
public class PickThreeLottery{
public static void main( String[] args ){
// cut and paste the line below in the methods as needed
Scanner keyboard = new Scanner(System.in);
// enter your code here
}
}
Lab 3.2 - PickThreeLottery.java To win the Pick 3 lottery in Ohio with a straight bet, a player must correctly choose 3 digits (0-9) in the order in which they are drawn. For example, if the user chooses 2-0-2 and the numbers come up 2-2-0, they lose. It costs the user S1 for each set of numbers they choose, and the payout for winning is $500 Write a program to determine how many drawings it takes for the user to win the lottery and the total amount of money they earn/lose by completing the following tasks. 1. Ask the user for 2. Use a loop (do while would be good here to continue generating 3 integers between 0 and 9 until the 3 three separate digits. Make sure cach digit is between 0 and 9 digits generated match the user's numbers exactly 3. Keep track of the number of drawings it took for the user to win. 4. Tell the user how many drawings it took for them to win and their total earnings/losses. Use an if statement to differentiate between earning moneya nd losing money Save the program as PickThreeLottery.java. Sample Output Input a digit between 0 and 9: 10 Input a digit between 0 and 9: 4 Input a digit between 0 and 9:7 Input a digit between 0 and 9: 1 It took 941 drawings for you to win the lottery. You lost 441 dollars. Input a digit between 0 and 9:2 Input a digit between 0 and 9: 2 Input a digit between 0 and 9: 0 It took 124 drawings for you to win the lottery. You won 376 dollars
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
