Question
Employee Weekly Compensation Calculator TypeScript 1. Specifications Create TypeScripts that contains the specified interface, parent and child classes as per the class diagram The Employee
Employee Weekly Compensation Calculator TypeScript 1. Specifications
Create TypeScripts that contains the specified interface, parent and child classes as per the class diagram
The Employee interface specifies the following contract: i. displayInformation 1. The implementing classes will implement a method that will display the child employee details ii. calculateCompensation 1. The implementing classes will implement this method using business rules specified below iii. saveEmployee 1. The implementing classes will implement this method and execute the data validation methods.
The Employee class will validate: i. The age of the employee must be greater than or equal to 16 1. Display a console message upon failure ii. The rank must be between 1 and five inclusive 1. Display a console message upon failure iii. The SSN must match the pattern: ###-###-### (Use RegEx) 1. Display a console message upon failure
The Fulltime Employee Compensation is calculated with the following business rules within the calculateSalary method: i. Overtime hours between 1 10 are paid at 1.25 times the hourly rate ii. Overtime hours between 11 20 are paid at 1.5 times the hourly rate iii. Overtime hours between 21 30 are paid at 1.75 times the hourly rate iv. Overtime hours greater than 30 are paid at 2 times the hourly rate ((Salary/40 Hrs) * OT Hrs * 2) v. Overtime is added to the base salary when calculating the total compensation (calculateCompensation)
The Contract Employee Compensation is calculated with the following business rules within the calculateSalary method: i. Overtime is paid out at a rate of 1.5 times the hourly rate for hours greater than 40 1. Example: a. Rate of $30/hr for the first 40 hours, $45/hr for all hours beyond 40 Create a console application which instantiates a Fulltime employee and Contract Employee and: i. Sets all properties ii. Calles the saveEmployee and within the save executes the validation of Age, Rank and SSN iii. A valid save state of each employee type will the display the details for the fulltime and contract employees by calling displayInformation iv. Create one employee object that fails the validation checks for Age, Rank and SSN to test the validations
Employee Employee +ssn string + lastName: string +firstName string address string +rank: number age: number - validateAge0 boolean validateRank): boolean - validate SSNO: boolean FullTimeEmplovee ContractEmployee +salary number +bonus number + overtimeHours number + hours : number +hourlyRate: number calculateSalary numberStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started