User Story

As a lottery administrator, I want an interface so that I can easily buy tickets on behalf of my customers and administrate the winnings.

Acceptance Criteria

In Script

  • Must have an initial money pot of 200$
  • Must only allow 50 tickets to be purchased for a single draw, ensure they are numbered from 1 to 50
  • Must be able to buy a ticket by providing a first name, ensure to show the purchased ticket with the provided name on screen, the price of one ticket is 10$
  • A draw must include all 50 tickets, purchased or not
  • A draw must pick 3 tickets at random
  • Must be able to draw at any time, a draw with no winner is possible
  • Must show the winning tickets with the names associated with them, if applicable
  • Ensure only half the money pot can be won.
  • Ensure the prizes are split like so:
    • The first ticket drawn wins 75%
    • The second ticket drawn wins 15%
    • The third ticket drawn wins 10%
  • Must be able to restart the process
  • Ensure the money pot is carried over for the next draw

Example

Let's say the money pot contains 200$. If there were a draw, the prizes would be given as follows:

  • 75$ for the first ticket
  • 15$ for the second ticket
  • 10$ for the third ticket

Notes

  • A console application is acceptable. If you do, ensure the functionalities mentioned above can be executed with the commands purchase, draw and winners.
  • No need to store information on disk or in a database
  • You can round or truncate amounts to the nearest dollar value
  • Make use of a design pattern of your choice
  • Well Documented -Comment everything clearly
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.