Question
The manager of the factory has decided to assign some workers from each product line to attend training workshops in order to know how to
The manager of the factory has decided to assign some workers from each product line to attend training workshops in order to know how to use the new machines where workshops will be given by engineers from the company manufactured the machines. In this TMA, it is required to help the manager of the factory keep track of the workshops and workers assigned to them.
Requirements:
After a quick meeting with the manager of the factory, you got the following information:
Each worker has a civil ID (which is unique), a name and cannot attend a workshop not given to his/her product line.
Each engineer has a civil ID (which is unique), a name and other attributes (add at least 2 attributes from your choice). He/she could give more than one workshop.
There is a unique reference number for each workshop. Each workshop will be given by an engineer and to a specific product line. Workers could be added or removed from a workshop within a given limit for the maximum number of workers who could attend the same workshop (where this limit is fixed and unified for all workshops). Furthermore, there are other attributes (add at least one attribute from your choice).
The whole data (all workshops of all product lines) should be stored in one collection. Moreover, you have been informed that the following operations happen frequently:
Creating a new workshop
Adding a worker to a specified workshop
Removing a worker from a specified workshop
Retrieving the average number of workers per workshop of a certain product line
Displaying all workshops in a format similar to the following:
product line1: workshopRefNo1, workshopRefNo2, …, lastWorkshopRefNo
product line2: workshopRefNo1, workshopRefNo2, …, lastWorkshopRefNo… where product lines and workshops are sorted in ascending order
Saving all the workshops into a text file
Q :
Implementation:
After analysing the given requirements, implement the required application:
with Object Oriented Programming style
following the rules of good programming style (e.g. adding comments, etc.)
using only the material covered in M251 (and its prerequisites)
For each class, it is required to implement constructors, setters, getters, toString() method, and any other necessary method
If the user tries to do an operation that could violate the state of objects, the operation should be ignored and the application should display an error message (e.g. adding a worker to the same workshop twice, etc.)
Checking equality of any 2 objects should be done via the equals() method
There is a class that will do the main job of keep tracking of the workshops as follows:
o It has one collection to store the whole data (all workshops of all product lines)
o It has static methods, one for each operation happens frequently
o For each adding or removing operation, a message should be displayed to the user to explain the status of the operation (i.e. if it was successful or not)
Testing:
After implementing the required classes, design and implement a testing class to test them as follows:
Create at least 7 workshops for at least 3 product lines and add them to the collection that stores the whole data then add and remove some workers from them.
Try to violate the state of the objects and show that your code prevents all violations.
Show that the other operations that happen frequently are working fine.
At the end, the whole data should be saved into a text file and this file should be saved automatically inside the folder contains your Java project.
Step by Step Solution
3.44 Rating (154 Votes )
There are 3 Steps involved in it
Step: 1
Answer Code is written below Please give me a like its helps me a lot Stepbystep explanation Answer Code Snippet import javautil class CourseManager t...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started