1.Create a class Lottery that will contain as an attribute a list of generated numbers from 1 to 20 (at the beginning it will be empty)2. Create a constructor and all the necessary methods for the...

1.Create a class Lottery that will contain as an attribute a list of generated numbers from 1 to 20 (at the beginning it will be empty)2. Create a constructor and all the necessary methods for the class (also your own which you may need to complete the work if any).3. It will have 2 important methods - draw (which generates a random number and adds it to the list- will write what number has just been drawn) and method Write down list which will write down all the numbers in it
Think about it and expand the example so that it is possible to generate colors (red, orange and blue) using the lottery (when working, create the second attribute listColors in the lottery)
Make the application so that it can be controlled via the console after startup using options 1,2,3 ...
For example:
--------------Choose an action1. Draw the number2. Draw color3. List the colors4. Write down the numbers5. Clean the list6. Finish
Apr 26, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here