Question: Payroll Processing App--Optionals and Type Casting Note: chosen programming Language is SWIFT.(Xcode) Thanks. Create a macOS project (Command Line Tool), for a payroll processing application
Payroll Processing App--Optionals and Type Casting
Note: chosen programming Language is "SWIFT".(Xcode) Thanks.
Create a macOS project (Command Line Tool), for a payroll processing application to be used by a higher-education institution (college/university). The application is to calculate the payment to be made to each employee at the end of each pay period. Assume employees in this institution are paid monthly. For each employee, the monthly payment will be the sum of the employee's monthly salary and any overtime pay for that month.
1) Begin by creating a class Employee. Each employee has a name and an annual salary. Add a computed property monthly pay. Be sure to include a class initializer.
2) There are two categories of employees in this institution: faculty and staff. Staff employees may work over time and when they do, the overtime pay of a staff employee is calculated as the product of the employees overtime hourly pay rate and the number of hours worked.
Faculty may teach extra classes and get paid for their over time teaching load based on the number of credit hours and teaching pay rate per credit hour. The teaching overtime pay rate (per credit hour) is the same for all faculty.
Create two subclassed of class Employee: one for staff and one for faculty based on the above specifications. Note: you need to decide which properties to include for each, the type of each property, and whether the property should be an instance property or a type property.
3) Write a function that takes an Employeeinstance and returns the total payment to be made to the employee for the pay period. Your function should use type casting to determine how to calculate the total payment depending on the type of employee.
4) Write a piece of code to test your application. Your test code should:
a) Prompt the user to enter the employee's category.
b) Based on the employee category entered, create an employee instance of the appropriate class.
c) Prompt the user to enter the rest of the employees information and populate the instance.
d) In the above step, validate all numerical input (in each case, use a loop that keeps prompting the user until a valid input is entered).
e) Calculate the employees payment by calling the function step 3 above and display the output in the format:
Employee name:
Employee category:
Payment:
Assignment Delievrables: Submit a copy of your code in a textfile and screenshot of your program's excution for two test cases (a faculty and a staff).
Bonus (20% extra): Instead of creating this project for the macOS console, create an iOS application to do the same. Need to demo your app for the bonus credits.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
