Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A company has three employee categories: salaried, wage and part-time. All employees have an employee ID number, name and SIN. Salaried employees have ID numbers


A company has three employee categories: salaried, wage and part-time. All employees have an employee ID number, name and SIN. Salaried employees have ID numbers starting with 0-4, whereas wage employee's IDs start with 5-7 and part-time employee's IDs start with 8-9. All employees are paid weekly and payment for each employee category is calculated as follows:

  • Salaried employees are paid a set salary each week.
  • Wage employees' pay is calculated using hourly rate * work hours with overtime paid at time and a half for any hours worked over 40 in one week.
  • Part-time employees' pay is calculated based on hourly rate * work hours with no overtime paid.

Instructions

  1. Create the classes as shown in the diagram on the following page.
  2. Place the employees.txt data file in the res folder.
  3. Create an inheritance tree whereby Salaried, PartTime and Wages inherit from Employee.
  4. Create an application with the following methods:
    1. Fill a list with objects based on the supplied data file.
    2. Calculate and return the average weekly pay for all employees.
    3. Calculate and return the highest weekly pay for the wage employees, including the name of the employee.
    4. Calculate and return the lowest salary for the salaried employees, including the name of the employee.
    5. What percentage of the company's employees fall into each employee category?



The UML Diagram for the case study is shown below. Getters() and Setters() implies the set of methods that act as Getters and Setters for the private variables.

imageimage

Salaried +GetPay(): double +ToString(): string -id: string -name: string -address: string phone: string -sin: long dob: string -dept: string +Employee +Employee(id: string, name: string, address: string, phone: string, sin: long, dob: string, dept: string) +Getters) +Setters() +ToString(): string -salary: double +Salaried +Salaried(id: string, name: string, address: string, phone: string, sin: long, dob: string, dept: string, salary: double) +Getters() +Setters() -rate: double -hours: double Employee +Getters +Setters() +GetPay +ToString(): string PartTime -rate: double -hours: double +Wages +Wageslid: string, name: string, address: string, phone: string, sin: long, dob: string, dept: string, rate: double, hours: double) +Getters() +Setters +GetPay +ToString(): string +PartTime() +PartTime(id: string, name: string, address: string, phone: string, sin: long, dob: string, dept: string, rate: double, hours: double) Wages

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamental Accounting Principles Volume 1

Authors: Kermit Larson, Tilly Jensen, Heidi Dieckmann

15th Canadian Edition

1259259803, 978-1259259807

More Books

Students also viewed these Algorithms questions

Question

Calculate the missing value.

Answered: 1 week ago