OOP编程 | UML作业 | CS作业代写: 这是一个利用OOP面向对象编程的代写，绘制UML是核心任务
McGill COMP 303 Mini QUESTION 1: UML CLASS DIAGRAM
The following case study may have additional information that cannot fit within a class diagram. Determine which information can fit in the class diagram and attempt to draw a complete and optimal UML class diagram for this case study.
You answer will contain two things:
- An optimal UML Class Diagram that exploits well designed techniques
- A paragraph describing the parts of the case study that cannot be implemented in a UML class diagram, and suggest the optimal UML diagram to use instead for this additional information. Select UML diagrams only based on what we covered in class.
Company ABC wants their 20 employees to punch in and out from work using a computer. The softwares menu has the following options: punch-in, punch-out, employee check punch history, manager check widget production history, and quit. ABC builds between 10 to 100 widgets per day from raw material. They track both raw material and widgets. Four units of raw material are needed to create a single widget. All widgets that are created are shipped to customers. Company ABC wants the software to track employee work hours and produce employee widget production statistics, nothing more. An employee punches in each time they create a widget. They input their employee ID. The system validates their ID before accepting the punch-in. If they are constructing more than one widget there is an optional place to enter the number of widgets created, otherwise it assumes one widget. After they finish building a widget, they place the finished widget in the shipping room and punch out. The system records the amount of time it took them to create those n widgets, saving that into a database as a punch transaction (containing punch-in time, punch-out time, quantity of widgets, and employee ID). If they plan to build another widget from raw material, they then get additional raw material and they punch in again. At the end of the day the manager generates a report of the number of widgets created for a period by employee (widget production history). The manager must also enter their ID number, which is also validated by the system, before they can use it. By default, the system assumes the current date but optionally the manager can specify a date range. The report lists each employee and the quantity of widgets they built within the specified period.
If you need additional objects to make this into a complete application, then that is to your discretion.
McGill COMP 303 Mini #
Vybihal School of Computer Science Page 2 of 2
QUESTION 2: UML SEQUENCE DIAGRAM
Network communication works by assuming three black boxes: a Sender, a Receiver, and the Network. The Sender has a sending function that sends a packet into the Network. The network may or may not succeed in routing the packet to the Receiver. A Receiver function, at the destination computer, listens to the network for packets, capturing any packet that arrives.
The Sender function works this way: 1- it receives a string to transmit, 2- it listens to the network waiting for it to be quiet, 3- once it becomes quiet it transmits the packet, 4- it sets a timer for n milliseconds, 5- it waits for a confirmation packet from the destination computer informing of successful delivery, 6- if confirmation arrives before the timer it cancels the timer and returns true. If an error packet is received it cancels the timers and returns false. If the timer goes off, it then repeats the process (2-6) (it tries again). It will attempt this three times. If the timer goes off three times in a row then, it cancels the timer and returns false. 7 – Program will end.
The receiver function works this way: 1- it begins in a busy loop waiting for a packet, 2- when a packet arrives it saves it in a buffer, 3- it waits for the network to be quiet, 4- then it transmits a confirmation packet, 5- it does not wait for anything else it simply returns the packet and ends.
Draw the sequence diagram.
WHAT TO HAND IN
- Question 1: o ClassDiagram.pdf o Q1PartB.pdf
- Question 2: o Sequence.pdf
HOW IT WILL BE GRADED
For your assignment to be graded your solution must followed the assignment instructions. You are
doing this assignment on your own.
- 10 Class diagram
- +5 Question 1 , part B
- +10 Sequence diagram