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:30
Selective incapacitation is a strategy to reduce prison population
Answers: 3
question
Computers and Technology, 23.06.2019 12:00
If you embed a word table into powerpoint, what happens when you make edits to the embedded data? a. edits made to embedded data change the data in the source file; however, edits made to the source file will not be reflected in the embedded data. b. edits made to embedded data will change the data in the source file, and edits made to the source file will be reflected in the embedded data. c. edits made to embedded data don't change the data in the source file, nor will edits made to the source file be reflected in the embedded data. d. edits made to embedded data don't change the data in the source file; however, edits made to the source file will be reflected in the embedded data.
Answers: 1
question
Computers and Technology, 23.06.2019 15:00
Plz ( which is an example of a good url?
Answers: 1
question
Computers and Technology, 23.06.2019 18:00
File account.java (see previous exercise) contains a definition for a simple bank account class with methods to withdraw, deposit, get the balance and account number, and return a string representation. note that the constructor for this class creates a random account number. save this class to your directory and study it to see how it works. then write the following additional code: 1. suppose the bank wants to keep track of how many accounts exist. a. declare a private static integer variable numaccounts to hold this value. like all instance and static variables, it will be initialized (to 0, since it’s an int) automatically. b. add code to the constructor to increment this variable every time an account is created. c. add a static method getnumaccounts that returns the total number of accounts. think about why this method should be static - its information is not related to any particular account. d. file testaccounts1.java contains a simple program that creates the specified number of bank accounts then uses the getnumaccounts method to find how many accounts were created. save it to your directory, then use it to test your modified account class.
Answers: 3
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, 21.01.2021 23:20
question
Health, 21.01.2021 23:20
question
English, 21.01.2021 23:20
question
Social Studies, 21.01.2021 23:20