![korar8737](/avatars/38317.jpg)
korar8737
19.10.2020 •
Computers and Technology
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.
Solved
Show answers
More tips
- O Other What is the oldest joke ever told?...
- F Food and Cooking How to Make Lazy Cabbage Rolls? Simple Steps to a Delicious Dish...
- F Food and Cooking Unusually Delicious Shashlik - Follow the Etiquette of Proper Preparation!...
- L Leisure and Entertainment Couchsurfing: A New Way to Travel...
- G Goods and services Which TV is better - LCD or Plasma?...
- S Sport How to Learn to Pull Up on Monkey Bars?...
- L Leisure and Entertainment Scrapbooking: What is it and Why is it Becoming More Popular?...
- C Computers and Internet Where did torrents.ru move to?...
- B Business and Finance Understanding Cash Flow: What It Is and How It Works...
- C Computers and Internet What Are Peers and Seeds in Torrenting?...
Answers on questions: Computers and Technology
- C Computers and Technology Which of the following is a renewable form of energy? a. gasoline. b.natural gas. c. wind. d. coal....
- M Mathematics Ryan buys 5 tickets for the school play, Each ticket costs $8. How much does Ryan spend in all?...
- H History What is the main function of the Legislative branch? Will give brainliest...
- M Mathematics Solve the equation : |x| - 6 = 4...
- P Physics Can someone make a padlet plz im super bored...
- E Engineering in the question 7 above assume that 1 skilled worker and 2 general workers were injured. Also assume that due to the injuries, 1 skilled worker has to be away from...
- M Mathematics Can someone help me asap!...
- B Biology Explain three impacts the south Asia’s brown cloud could have?...
- G German Alguém aq é BR? please.......
- E English How did everything change with Programma 101?...
Ответ: