You are on page 1of 2

Data Structures and Algorithms COMP-254

Lab Assignment #2 – Algorithm Analysis

Purpose: The purpose of this Lab assignment is to:


• Perform experimental analysis of algorithms

Be sure to read the following general instructions carefully:


- This assignment must be completed individually by all the students.
- You will have to demonstrate your solution in a scheduled lab session and upload the
solution on eCentennial through the assignment link.

Exercise 1

Efficient Lottery Draw Application using Data Structures and Algorithms

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 distribution of awards for the winners is predefined as follows:


- Winner 01: 40% of the total draw amount
- Winner 02: 30% of the total draw amount
- Winner 03: 20% of the total draw amount
- Winner 04: 10% of the total draw amount

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:

Correct implementation of requirements: 90%


• Correct result of running time
• Correct experimental analyses code and
visualization
• Explanation of proof or analyses when
asked
Friendly graphical display 10%

Total 100%

You must name your IntelliJ project according to the following rule:
YourFullname_COMP254Labnumber_Exercisenumber.

Example: JohnSmith_ COMP254Lab2_Ex1

Submission rules:

Submit your modules as zip files that are named according to the following rule:
YourFullname_ COMP254Labnumber_Exercisenumber.zip

Example: JohnSmith_ COMP254Lab2_Ex1.zip

Lab #1 Page 2 of 2

You might also like