COMP254 - 009 - Assignment 2
COMP254 - 009 - Assignment 2
Exercise 1
In this assignment, Design and implement a lottery application that allows users to purchase tickets
for a draw with a fixed ticket price of $20. The goal is to create an algorithm that accurately selects
four winners from a pool of users who have purchased tickets. To ensure robust testing, there
should be a minimum of 20 users participating.
The total draw amount is calculated by multiplying the total number of tickets purchased by
combining all users with the price of a single ticket ($20).
To maintain fairness and adherence to the terms and conditions, each user can only win once. If a
user has multiple winning tickets, only one ticket will be considered for that user, and a new ticket
number will be chosen for subsequent draws. This ensures that each draw has a unique set of
winners.
The implementation of this lottery application will employ efficient data structures to handle the
ticket purchasing, winner selection, and tracking of user winnings. Special consideration will be
given to time and code complexity to ensure a scalable and performant solution.
This assignment should showcase knowledge of data structures, algorithms, and logical thinking
in the context of a real-world application. It challenges students to design a fair and efficient lottery
system while adhering to specified rules and conditions.
Lab #1 Page 1 of 2
Data Structures and Algorithms COMP-254
Evaluation:
Total 100%
You must name your IntelliJ project according to the following rule:
YourFullname_COMP254Labnumber_Exercisenumber.
Submission rules:
Submit your modules as zip files that are named according to the following rule:
YourFullname_ COMP254Labnumber_Exercisenumber.zip
Lab #1 Page 2 of 2