Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Can you please complete this program? CSC108 - Introduction to Programming Lab05 Play10 Lottery Game: This simulates a lottery game that generates a random integer
Can you please complete this program?
CSC108 - Introduction to Programming Lab05 Play10 Lottery Game: This simulates a lottery game that generates a random integer between 1 and 10, and then allows the user to purchase lottery tickets for $2.00 a piece to try and win money if the purchased tickets' integer match the winning integer. The odds of winning are 1:9 (winning outcomes to losing outcomes). The probability of winning is expressed as 1/10 (1 winner in 10 outcomes), so a $2.00 ticket that matches the winning integer will receive a fair payout of $20.00. Create a Java application in NetBeans called "Lab05" that asks the user how many tickets will be purchased, confirms the credit card charges for the tickets, and then asks if the user wants to have the computer generate the guesses between 1 and 10. If so, the program should use the following formula to generate the random guesses and the random winning integer: randomInteger =min+( int ) (Math. random ()((maxmin)+1)). In this case, the min is 1 , and the max is 10. If the guesses are not computer generated, the program asks the user to enter the guesses. Once done, the guesses are compared to the winning integer, and total winnings and losings are accumulated and you are to report the tickets that are winners. The ticket price must be declared as a constant, set to $2.00, in your program. You can concatenate this ticket information into a String variable called "report" inside a for loop, and then print the report variable after completing the for loop. Then, print the total winnings, the remaining balance after subtracting credit card charges. Study the sample runs below, and note the checking of the inputted data for errors. 3 Please enter quess 5 : 10 The winning number is 5 Ticket 3 is a winner Your total winnings is $20.00 After subtracting your credit card charge of $10.00 from your winnings, your balance is $10.00 For assistance, see the flowchart below. Zoom in to read the details. Zip the Lab05 folder. Rename the zip file to "Your Name Labos.zip" (e.g. Joe Student Labos.zip), and send it to me as an attachment in Blackboard CSC108 - Introduction to Programming Lab05 Play10 Lottery Game: This simulates a lottery game that generates a random integer between 1 and 10, and then allows the user to purchase lottery tickets for $2.00 a piece to try and win money if the purchased tickets' integer match the winning integer. The odds of winning are 1:9 (winning outcomes to losing outcomes). The probability of winning is expressed as 1/10 (1 winner in 10 outcomes), so a $2.00 ticket that matches the winning integer will receive a fair payout of $20.00. Create a Java application in NetBeans called "Lab05" that asks the user how many tickets will be purchased, confirms the credit card charges for the tickets, and then asks if the user wants to have the computer generate the guesses between 1 and 10. If so, the program should use the following formula to generate the random guesses and the random winning integer: randomInteger =min+( int ) (Math. random ()((maxmin)+1)). In this case, the min is 1 , and the max is 10. If the guesses are not computer generated, the program asks the user to enter the guesses. Once done, the guesses are compared to the winning integer, and total winnings and losings are accumulated and you are to report the tickets that are winners. The ticket price must be declared as a constant, set to $2.00, in your program. You can concatenate this ticket information into a String variable called "report" inside a for loop, and then print the report variable after completing the for loop. Then, print the total winnings, the remaining balance after subtracting credit card charges. Study the sample runs below, and note the checking of the inputted data for errors. 3 Please enter quess 5 : 10 The winning number is 5 Ticket 3 is a winner Your total winnings is $20.00 After subtracting your credit card charge of $10.00 from your winnings, your balance is $10.00 For assistance, see the flowchart below. Zoom in to read the details. Zip the Lab05 folder. Rename the zip file to "Your Name Labos.zip" (e.g. Joe Student Labos.zip), and send it to me as an attachment in BlackboardStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started