Sda A2
Sda A2
You are tasked with understanding and applying the concepts of Robustness Classes (ECB), Real time
Activity, and Threads and synchronization applications in Java.
Students can join societies through an annual membership process, which includes membership
tiers like regular, premium, and honorary. Each tier comes with different privileges, such as access
to exclusive events, discounts on event fees, and voting rights in society elections. The membership
process involves an online registration form, approval from the society administration, and
payment of membership fees. Memberships are renewable annually, and the system sends
automated reminders to students when their membership is about to expire. Each student's role
within the society, including their activity history, attendance at society meetings, and participation
in events, is tracked.
Societies organize multiple events throughout the academic year, such as workshops,
competitions, charity drives, and cultural festivals. These events are open to both members and
non-members, with different fee structures for each category. Event registration is handled through
the system, which provides details like event dates, descriptions, schedules, guest speakers, and
venue capacity. The system also manages event logistics, such as tracking ticket sales, ensuring
venue availability, and coordinating with external sponsors or partners.
A critical feature of the system is financial management. Every society manages its own budget,
which is used to fund events, pay for external speakers, book venues, and produce marketing
materials. The system tracks the society's financial transactions, including membership fees, event
fees, sponsorships, and other forms of income. It also tracks expenditures, such as equipment
purchases, venue rentals, and other operational costs. Each society’s treasurer can generate
financial reports through the system, and university administration can audit these reports for
transparency.
The system also includes a grievance management module. Students can file complaints or
feedback about society activities, leadership issues, or event mishaps. The system categorizes these
complaints, forwards them to the relevant committee members for resolution, and tracks their
status until they are addressed.
In addition, the system allows societies to collaborate for joint events. For instance, two societies
may organize a combined cultural festival, and the system must track joint budgeting, shared roles,
and joint ticketing for such events. Societies can also invite external organizations or alumni to
partner in events, requiring external accounts in the system to manage these collaborations.
Finally, the system provides a performance analysis dashboard, where society leaders can assess
their membership growth, event attendance trends, budget utilization, and student engagement.
This data helps in decision-making, allowing societies to improve their offerings and
engagement strategies.
This Student Society Management System integrates multiple modules, ensuring smooth
functioning of societies, transparent financial and electoral processes, event management, and
collaboration among students, while providing tools to analyze society performance and improve
student participation.
A company is developing an online system to process orders for their e-commerce platform. As
the business grows, orders arrive concurrently, and they must be processed efficiently to ensure
smooth operation and timely fulfillment.
To handle this, they decide to implement a multithreaded solution using. Each order must be
processed independently, with tasks like verifying payment, checking inventory, updating the
database, and sending confirmation emails. These tasks need to run concurrently to reduce
delays.
Requirements:
1. Order Processing: Each order must be processed in its own thread, ensuring independent
and concurrent execution of order tasks.
2. Task Breakdown: The processing of each order involves multiple steps:
Payment verification
Inventory check
Database update
Confirmation email
3. Efficient Management: Threads need to be efficiently managed to prevent overloading
the system, ensure optimal performance, and avoid issues like creating too many threads or
keeping idle threads alive.
4. Scalability: The system must handle high volumes of orders during peak periods while
being scalable enough to deal with fluctuating traffic.
Draw an activity diagram for the use case narrative mentioned below:
Q3: Multithreading - Executer Framework
Java Multithreading Real life application scenario
Real-Life Scenario:
You are tasked with developing a multi-threaded data analysis application for a financial services
company. The application processes a large dataset of transaction amounts to compute various
statistical metrics essential for financial reporting and risk assessment. To optimize performance
and reduce computation time, you decide to leverage Java's Executor Framework to perform
these calculations concurrently using multiple threads.
Requirements:
1. Task Classes:
o MeanTask: Calculates and prints the mean (average) of the transaction amounts.
o VarianceTask: Calculates and prints the variance of the transaction amounts.
o StdDevTask: Calculates and prints the standard deviation of the transaction
amounts.
o MedianTask: Calculates and prints the median of the transaction amounts.
2. Executor Framework:
o Utilize Java's ExecutorService to manage and execute the tasks concurrently.
o Ensure that all computation tasks are submitted to the executor for parallel
execution.
o After submitting all tasks, properly shut down the executor service.
3. Data Handling:
o Assume you have a collection of transaction amounts represented as a
List<Double>.
o Since all tasks are read-only operations on the data, thread-safe access is
inherently ensured.
4. Implementation:
o Modify the provided PrintTask.java and TaskExecutor.java classes to
accommodate the new tasks and requirements. (examples demonstrated to you in
the class)
o Create separate classes for each statistical computation, each implementing the
Runnable interface.
o Each task, upon completion of its computation, should print its respective result
immediately.
o There is no need for a separate task to aggregate or print all results collectively.
o Manage task dependencies internally within each task if necessary (e.g., Variance
and Standard Deviation depend on the Mean).
5. Manage Concurrency:
o Use ExecutorService to execute tasks concurrently.
o Since some tasks depend on the results of others (e.g., Variance depends on
Mean), handle dependencies within the tasks themselves.
6. Implement the Main Executor:
o Initialize the data.
o Create and submit all tasks to the executor.
o Shut down the executor after task submission.
Your Task:
Design and implement the application based on the above requirements. Ensure that each
statistical computation is handled by its own thread, and results are printed as soon as each
computation completes. Utilize Java's Executor Framework to manage the lifecycle of these
threads efficiently.
SUBMISSION GUIDELINES:
1. Last date of submission is 16th October 2024 – 11 AM.
2. Students are required to submit the assignment individually.
3. Only 1 submission is allowed, if you once submit it then you are allowed to update your submission.
4. You need to submit in your section only. If you submit in wrong section or both sections or if you
violate any assignment instructions then expect negative marking.
5. Email submission not allowed. Emails queries asking hints for solution will result in negative
marking.
6. If you upload empty or corrupted archive, you will get zero marks. Hence double check before
uploading.
7. Plagiarism, if detected, will result in zero marks.
8. Assignment should NOT be handwritten, make sure you submit it according to the requirements.
9. Submit the assignment after making a single zip archive of the assignment files. Submit in “zip folder
only” no rar, no any other format is accepted.
10. Folder hierarchy: MS Word document report) in /doc folder, source code and eclipse / papyrus or
vs-code project in /code folder, all exported PNG diagrams in /dia folder and Papyrus models and
project files in /model directory are required. Use only Papyrus for modeling and submit the project
files. (If you don't follow the instructions it may lead to marks deductions).
11. Contents of MS word report:
a. Cover Page of Assignment document must contain: Student name, Roll no, Date of submission.
b. Answers to all the questions
c. screenshot of all UML diagrams
d. Source code for Q3: Executer Framework. Use mono-spaced type font for code.
e. Screenshots of working program for Q3.
12. Archive the assignment and name it “FASTAssign02YourRollNo.zip”