
I am trying to create a lottery game application in Java. I want it to generate three random numbers between 0 and 9 (including 0 and 9). Then, the user will input their three guesses of what the winning numbers will be. Next, compare each of the user's guesses to the three random numbers and display a message that includes the user's guess, the randomly determined three digits, and the amount of money the user has won. I need to make certain that this application accommodates repeating digits. For example, if a user guesses 1, 2, and 3, and the randomly generated digits are 1, 1, and 1, do not give the user credit for three correct guesses-just one. (From this, it stands to reason that if the randomly generated digits include 2 repeated digits, that they also should be counted as-just one.)
This is an example of the final output I am hoping to achieve with this program:
Guess the 3 numbers I have chosen.
Guess 1 right $10
Guess 2 right $100
Guess 3 right (any order) $1,000
Guess 3 right (exact order) $1,000,000
Enter the 1st number: 1
Enter the 2nd number: 4
Enter the 3rd number: 5
Computer picks: 1 2 3 You guessed: 1 4 5
1 Match, you win $10
I want to try and identify ALL test cases. A test case will include the input necessary to create an expected output.
So far in my program, I have:
![D2L ZyBooks Chapter 3 PA/CA/Lab X
←
C
onlinegdb.com/#
SPONSOR Gitlab - Loved by developers. Trusted by enterprises. Start your free 30 day trial. X
Run
LotteryGameApplic... :
16
17
18
19
20
21
22
23
24
25
26
27
28
GDB online Debugger | Comp X D21 Homework Instructions - CSC × b Home | bartleby
Debug
Stop
Share
1
2
3
4- public class LotteryGameApplication{
5
6-
7
8
9
10
11
12
13
14
15
H Save
public static void main(String[] args) {
//User enters three guesses
System.out.println("Guess the three numbers I have chosen
System.out.println("Guess 1 right
System.out.println("Guess 2 right
System.out.println("Guess 3 right (any order)
System.out.println("Guess
3 right (exact order)
System.out.println("Enter the 1st number: ");
System.out.println("Enter the 2nd number: ");
System.out.println("Enter the 3rd number: ");
//Winnings
final double ZeroDollars
final double TenDollars
final double Hundred Dollars
1000;
final double Thousand Dollars
final double AMillion Dollars = 1000000;
input
{} Beautify
-
0;
10;
-
=
100;
//Reveals Winning Lottery Numbers
int min 0:
x +
between 0 and 9. ");
$10");
$100");
$1000");
$1,000,000");
stderr
Language Java
Ⓒ
GI
Ⓡ
PH
€0](https://content.bartleby.com/qna-images/question/c60c9d1f-b3f6-4480-9546-9a7e3a18aff9/20d8de06-e17c-43e7-89de-863a0b2c766c/592bon5_thumbnail.png)


Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 6 images

- Add Fractions problem: create in a sandbox environment. Directions: In this program you will ask the user for 4 integers that represtent two fractions. First ask for the numerator of the first and then the denominator. Then ask for the numerator and denominator of the second. Your program should add the two fractions and print out the result. For example: a sample program run might look like this, Numerator One: 1 Denominator One: 2 Numerator Two: 2 Denominator Two: 5 The sum is 9/10 //remember if you have two fractions, the following formula should be used: a/b + c/d = (a*d +b*c) / b* d public class MyProgram { public static void main(String[] args) { //Ask the user for 4 numbers. (don't forget to import your Scanner class) //create your final numerator //create your final denominator //print out your result like the example abovearrow_forwardUsing pythonarrow_forwardWrite an application that counts by five from 5 through 500 inclusive and that starts a new line after every multiple of 50 (50,100,150 and so on).Save the file as CountByAnything.javaarrow_forward
- write a program in Java that would ask the clerk to enter the total amount of the customer’s order. The program will then calculate a seven percent (7%) sales tax. Commission is computed based on the following: order amount id="mce_marker" - $200 commission is 2%, order amount $201 - $400 commission is 3%, order amount $401 - $600 commission is 4%, order amount > $600 commission is 5%, The program will display the following: a) The amount of customer’s order (eg. $500.00 or id="mce_marker",000.00) b) The tax amount c) The total amount including tax added d) Commission Amount e) The customer will make ten orders, display the average of the total order and the sum of all orders. You must use at least two methods. Write the output to a file named “Order.txt” The program should also display “Thanks for your business and please come again.”arrow_forwardX609: Magic Date A magic date is one when written in the following format, the month times the date equals the year e.g. 6/10/60. Write code that figures out if a user entered date is a magic date. The dates must be between 1 - 31, inclusive and the months between 1 - 12, inclusive. Let the user know whether they entered a magic date. If the input parameters are not valid, return false. Examples: magicDate(6, 10, 60) -> true magicDate(50, 12, 600) –> falsearrow_forward// A standard mortgage is paid monthly over 30 years. // This program is intended to display 360 payment coupons // for a new borrower. Each coupon lists the month number, // year number, and a friendly mailing reminder. start num MONTHS = 12 num YEARS = 30 string MSG = "Remember to allow 5 days for mailing" num monthCounter = 0 num yearCounter = 30 while yearCounter <= YEARS while monthCounter <= MONTHS output monthCounter, yearCounter, MSG endwhile endwhile stop housekeeping() print "Enter account number or ", QUIT, " to quit " return printCoupons() while yearCounter <= YEARS while monthCounter <= MONTHS print acctNum, monthCounter, yearCounter, MSG monthCounter = monthCounter + 1 endwhile yearCounter = yearCounter + 1 endwhile output "Enter account number or ", QUIT, " to quit " input acctNum return finish() output "End of job" returnarrow_forward
- Java Programming A bakery company provides a bonus of a new bakery product package for customers who buy at least 10 breads in the company anniversary award which will be celebrated in the next three months. To get the bonus, the customer is given the opportunity three times to guess a number determined by the application from numbers 1 to 20. For each guess number given by the customer, the application will respond as follows:• If the guessed number is smaller than the lucky number, you will see the words "Bigger Number"• If the guessed number is greater than the lucky number, you will see the words "Smaller Number"• If the guessed number is the same as a lucky number, it will match the words "Congratulations ... you found a LUCKY number"As part of the company's IT team, you serve to create a lucky number guessing game console.A. Determine the inputs and outputs of the design programb. Draw a Flowchart of the programc. Write Coding to make the applicationd. Give Screen shoot the…arrow_forwardDesign and implement an application that plays the Hi-Lo guessing game with numbers. The program should pick a random number between 1 and 100 (inclusive) and then repeatedly prompt the user to guess the number. On each guess, report to the user that he or she is correct or that the guess is high or low. Continue accepting guesses until the user guesses correctly or chooses to quit. Use a sentinel value to determine whether the user wants to quit. Count the number of guesses, and report that value when the user guesses correctly. At the end of each game (by quitting or a correct guess), prompt to determine whether the user wants to play again. Continue playing games until the user chooses to stop.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





