Java – LotterySimulator Solved

$ 24.99
Category:

Description

Write a program performs lottery code creation for a given number of tickets. Each code contains a group of digits followed by a group of characters. Only the characters “A”, “B”, “C”, “D” and “E” are used in the code. Here is an example code that contains 5 digits and 3 characters: 20165AEB

Your program should:
-­‐ ask from the user how many digits and characters will be used in code creation
-­‐ ask from the user the number of ticket codes to be created
-­‐ print all the codes created
-­‐ if the first digit is 5, it should also print that the ticket pays for itself (i.e. receives the lowest prize: “amorti”(TR))

Four different runs (screen shots) are provided below as example. (Since your program will call random generator, don’t expect to get exactly the same codes when you provide the same inputs as in the examples.) You can run the project as Java Applet if you cannot run it as Java
application. Hint: If you want to print just one character/digit and would like that the cursor waits for next character/digit at the next place, you should use ‘print’. ‘println’ by default adds an end of line character and moves the cursor to the next line after printing.

Reviews

There are no reviews yet.

Be the first to review “Java – LotterySimulator Solved”

Your email address will not be published. Required fields are marked *