In a Lotto game, the total number of balls is n and the number of balls drawn without replacement is k. Before the balls are drawn, you choose k numbers from 1 to n, sorted in order from smallest to largest. When the balls are drawn, if they match the numbers that you picked, you win.

The payoff depends on the number of winners and elapsed time since there was at least one winner.

Your job is to design a user interface that displays the lotto balls that are drawn when drawing up to balls from 5 total of 30 balls.

Use 5 image elements to display the ball images.

Use a button to perform the drawing.

Use a Lotto class object in the script lotto-class.js to simulate drawing the balls.

Use a CSS file to set the fonts, colors, and sizes of the elements on your page.

Include a link back to your index page.

The Lotto class object draws the balls with replacement and sorts them in numeric order before outputting them.

Extra Credit: Allow the user to choose how many balls from which to draw and how many balls to draw. This provides a variety of Lotto games to play.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.