Write a class called Person that has the attributes name, address, date of birth and cell phone number. This class should also include the following methods:
__init__ to initialize all attributes
Mutators for all attributes
Accessors for all attributes
__str__ to display the attributes in the following format:
Name: the name of the person
Address: the address of the person
Date of Birth: in the format mm/dd/yyyy
Cell Phone Number: the cell phone number of the person
Now, write a class called Employee that inherits from the Person class. This class should have the additional attributes Department and DateHired. Be sure to include Accessor and Mutator methods as well as __init__ and __str__.
Write two more classes, Commission and Hourly, that both inherit from Employee. The Commission class has two attributes, baseSalary and commissionRate. Be sure to include appropriate methods. Also include a method to calculate the total salary. Total salary is the base salary plus the commission earned (commissionRate times an input total sales amount).
The Hourly class should have 2 attributes, rateOfPay and hoursWorked. Be sure to include appropriate methods. Also include a method to calculate total salary.
Now write a main program that reads in employee data from a file. The file format is
Type of Employee - C for Commission and H for Hourly
Name
Address
Date of Birth
Cell Phone Number
Department
Date Hired
Base Salary (if commission) or Rate of Pay (if hourly)
Commission Rate (if commission) or hoursWorked (if hourly)
The file is comma delimited. The file is located in the I:\kopp\outbox\CS 121 02\Program Assignments folder. The file name is payroll.txt.
The program should print a report with the following information:
Name
Address
Date of Birth
Cell Phone Number
Department
Date Hired
Pay for this pay period
Be sure to use __str__ methods in each class so that you can print the object and get the correct output format.
YOU ARE REQUIRED TO WORK ON THIS BY YOURSELF. BE SURE TO DO YOUR OWN WORK. IF YOU WORK TOGETHER, ALL PARTIES WILL GET A 0.
You are required to use appropriate functions. Design will be included in grading.
Add the following comments to the beginning of the program.
Name: Your Name
Class and Section: CS 121 02
Assignment: Program Assignment 05
Due Date: See above
Date Turned in:
Program Description: You write a short description of what the program will do
When you complete the program, do the following.
1. Turn in a printout of the source code for both programs
2. Create a folder with the following name: Program 05