HW05-2 — O-O Design: Create a UML Diagram of An Inheritance SchemeAn Employee is someone who works for a large retail store like Walmart or Target. In this
assignment, you are going to be focusing on several specific kinds of Employee that will be
instantiated as part of a simulation of a particular day of operation in a retail store. Your
objective is to:
1. Sketch a UML class diagram for a viable inheritance hierarchy to show Employee,
Cashier, and SalesAssociate classes, plus at least two appropriate Interface(s).
Notes:
a) The overall design for the store would have other kinds of Employees – not part
of this assignment. Examples: Janitor, CafeteriaWorker
b) Your interface(s) must relate to this problem, and won’t be “Standard
Functional Interface” types.
c) You should design interfaces (perhaps more than just two!) that differentiate
between the capabilities of some subclasses over others. Also, consider that if all
subclasses shown in this analysis implement a given interface, perhaps other
employees not shown here won’t.
2.
For each class or interface, be sure and show relevant method headers. Indicate
abstract methods by underlining the method header.
[You don’t need to show getters and setters and constructor(s) in your diagram. ]
3. Take a photo or scan and upload your pdf, png, or jpeg of the diagram.
Below is some background information about the two classes, and the functionality required.
SalesAssociate: SalesAssociates can make a sale. [They write a “sales slip” and hand off to
the customer.] They must also keep track of the number of sales completed, as well as the
amount of revenue made from their overall sales.
Cashier: The Cashier receives a “sales slip” and payment for a sale from a customer, and the
merchandise is then retrieved from the storeroom and given to the customer. The Cashier has
to keep track of the amount of money in their drawer. They can also accept and process returns.
Further Information: Assume a Tester class will create two Cashiers and one Sales Associate
instance and add them into a polymorphic collection of Employees. Your design must allow for
a single traversal to display them all, with ALL information related to each one must be shown.
The displayEmployees method called by the driver iterates over the employees ArrayList and
prints out the following kinds of information:
[Continues on next page]
OOPDA HW5-2 rev4
p. 1
2/8/2024 1:03 PM
Here are the employees:
Cashier
Name: Franny Wilkins
ID: 100
Hourly Wage: 10.75
Productivity: 0.3
Drawer Amount: 1196.52
SalesAssociate
Name: Will Martin
ID: 166
Hourly Wage: 11.5
Productivity: 0.601205
Department: Shoes
Number of Sales: 3
Amount of Revenue: 202.41
Cashier
Name: Barbara Smith
ID: 76
Hourly Wage: 11.0
Productivity: 1.2
Drawer Amount: 3026.73
You will notice that every Employee has a productivity rating which is calculated as follows.
•
Cashiers will ring up sales at the register and complete returns. Each of these will count
as a transaction. As you can see from the example data above, the program will count the
number of cashier transactions. The daily transaction target for all cashiers is 20. In the
example above, Franny Wilkins only made 6 transactions, so her productivity is 30%.
•
Sales Associate’s productivity is calculated based on two metrics — number of sales and
amount of revenue. A sales associate has a daily target of 3 sales, and a target daily
revenue of $1000. In the example above, Will Martin did make 3 sales, making the sales
number metric 100%. However, he only brought in revenue of $202.40, making the
revenue generated metric about 20%. When you average these two metrics, you can see
that Will’s final productivity is 60%.
Draw the UML class diagram to support the functionality described!
[Note: You are not writing code for any of the actual methods – just the diagram.]
OOPDA HW5-2 rev4
p. 2
2/8/2024 1:03 PM