Reference no: EM131049739
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
Problems in a project
: 1. First read and analyze each problem; then implement both problems in a project called HW3. 2. For each exercise, insert comments on ID, Name, and HW#.
|
What is missing from current studies
: What do researchers agree or disagree about? What are the central themes and arguments in current studies? What is missing from current studies?
|
Making semiannual interest payments
: What is the value of a 20-year, noncallable bond with an annual coupon rate of 9.5%, but making semiannual interest payments? The bond has a face value of $1,000, and you require an annual 8.4% discount rate for this investment.
|
Show that the coefficients of the cosine terms are all zero
: The Fourier sine series is especially convenient for discussing functions that are zero at the end points x = 0 and L.
|
Additional attributes department and datehired
: 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__.
|
Purposes of the project portfolio process
: Which of the many purposes of the project portfolio process are most important to a firm with a low project management maturity? Which to a firm with high maturity?
|
Considered claims against companys future cash flows
: Many businesses find it generally more efficient to enlist the services of a financial institution when it comes time to raise capital: IE. Investment Banks: An organization that underwrites and distributes new investment securities and helps busines..
|
Animate your plots and describe the motion
: Take the wave speed on the string to be c = 1. (a) Sketch this initial shape and find the coefficients Bn, in its Fourier sine series (16.31). (b) Make plots of the sum of the first several terms for several closely spaced times between t = 0 and ..
|
Security and privacy issues in internet of things
: You are required to prepare and submit a report on your topic to address the following questions (the length of the report within 1500~2000 words, excluding references):
|