subject

Play10 Lottery Game: That 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: random Integer = min + (int) (Math. random() * ((max - min) + 1)). In this case, the min is 1, and the max is 10. Otherwise, the program asks the user to enter the guesses. Once done, compare the guesses to the winning integer, and accumulate the total winnings and losings and report the tickets that are winners. The ticket price must be declared as a constant, set to $2.00, in your program. You can accumulate this ticket information to a String output variable inside a for loop, and then print the output variable after completing the for loop. Report the total winnings, the remaining balance after subtracting credit card charges, and the amount that you can deduct from your taxes. The allowable tax deduction is the total amount of your losses up to the amount of your winnings (i. e. the minimum of your total winnings and total losses). Study the sample runs below, and note the checking of the inputted data for errors.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 06:00
Write a program that uses a widgetviewer object to do the following: generate two random integers between 1 and 9 (inclusive). name one of them x, the other y. display them to the user using jlabel objects. create a jlabel object displaying the text "enter an operation number." create a jtextfield for the user's input. create a jbutton displaying the text "press here when you've entered your operation." use addandwait to add it to the widgetviewer object. when the user clicks the jbutton, evaluate operation in the following order to determine the one and only mathematical operation to perform on x and y. use a jlabel to display the result. if operation is between 1 and 10 inclusive, add x and y. if operation is evenly divisible by 4, subtract y from x. if operation is evenly divisible by 5, use integer division to divide y into x. if operation is an even number, use floating point division to divide y into x. if none of the other tests on operation apply, multiply x and y. note: operation can be negative or zero.
Answers: 2
question
Computers and Technology, 22.06.2019 16:30
You have inserted new slides based on a word outline. how do you format these new slides to match the powerpoint presentation formatting? a. select all slides in the presentation and click format on the home tab. b. select the new slides and click reset on the home tab. c. select all slides in the presentation and click reset on the home tab. d. select the new slides and click format on the home tab.
Answers: 2
question
Computers and Technology, 23.06.2019 02:30
Three out of five seniors remain undecided about a college major at the end of their senior year.
Answers: 3
question
Computers and Technology, 23.06.2019 18:00
Which is a possible benefit of having a good credit history? having a checking account low interest rate on a car loan high interest rate on a credit card offer bankruptcy
Answers: 1
You know the right answer?
Play10 Lottery Game: That simulates a lottery game that generates a random integer between 1 and 10,...
Questions
question
Mathematics, 17.11.2020 22:10
question
Mathematics, 17.11.2020 22:10
question
Mathematics, 17.11.2020 22:10
question
Mathematics, 17.11.2020 22:10
question
English, 17.11.2020 22:10
Questions on the website: 13722362