//----- Employee.java -------
public class Employee {
private String firstName;
private String lastName;
private String address;
private String telephoneNumner;
private String socialSecurityNumber;
private double monthlyPaymentRate;
protected static final int TAX_RATE = 20;
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getTelephoneNumner() {
return telephoneNumner;
}
public void setTelephoneNumner(String telephoneNumner) {
this.telephoneNumner = telephoneNumner;
}
public String getSocialSecurityNumber() {
return socialSecurityNumber;
}
public void setSocialSecurityNumber(String socialSecurityNumber) {
this.socialSecurityNumber = socialSecurityNumber;
}
public double getMonthlyPaymentRate() {
return this.monthlyPaymentRate;
}
public void setMonthlyPaymentRate(double monthlyPaymentRate) {
this.monthlyPaymentRate = monthlyPaymentRate;
}
public double calculateAnnualSalary() {
double annualSalary = getMonthlyPaymentRate() * 12;
return annualSalary;
}
public double calculateAtualPayment() {
double actualPayment = calculateAnnualSalary();
System.out.println("\t Annual Salary :"+actualPayment);
double totalTax = actualPayment * TAX_RATE / 100;
System.out.println("\t Total Tax :"+totalTax);
actualPayment = actualPayment - totalTax;
System.out.println("\t-------------------------------");
System.out.println("\t Total Payment :"+actualPayment);
return actualPayment;
}
}
// ----- Technician.java ---------
public class Technician extends Employee{
private int overtimeHours;
private double overtimeRate;
public int getOvertimeHours() {
return overtimeHours;
}
public void setOvertimeHours(int overtimeHours) {
this.overtimeHours = overtimeHours;
}
public double getOvertimeRate() {
return overtimeRate;
}
public void setOvertimeRate(double overtimeRate) {
this.overtimeRate = overtimeRate;
}
@Override
public double calculateAtualPayment() {
double actualPayment = calculateAnnualSalary();
System.out.println("\t Annual Salary :"+actualPayment);
double overtimePayment = getOvertimeHours() * getOvertimeRate();
System.out.println("\t Over-Time Payment :"+overtimePayment);
actualPayment = calculateAnnualSalary() + overtimePayment;
double totalTax = actualPayment * TAX_RATE / 100;
System.out.println("\t Total Tax :"+totalTax);
actualPayment = actualPayment - totalTax;
System.out.println("\t-------------------------------");
System.out.println("\t Total Payment :"+actualPayment);
return actualPayment;
}
}
// -------- Engineer.java ----------
public class Engineer extends Employee {
}
// ------ Manager.java ----------
public class Manager extends Employee {
private static final int BONUS_RATE = 3;
private boolean isExcellentPerformer;
public boolean isExcellentPerformer() {
return isExcellentPerformer;
}
public void setExcellentPerformer(boolean isExcellentPerformer) {
this.isExcellentPerformer = isExcellentPerformer;
}
@Override
public double calculateAtualPayment() {
double actualPayment = calculateAnnualSalary();
System.out.println("\t Annual Salary :"+actualPayment);
double bonus = 0.0;
if(isExcellentPerformer()) {
bonus = actualPayment * BONUS_RATE / 100;
actualPayment = actualPayment + bonus;
}
System.out.println("\t Total Bonus :"+bonus);
double totalTax = actualPayment * TAX_RATE / 100;
System.out.println("\t Total Tax :"+totalTax);
actualPayment = actualPayment - totalTax;
System.out.println("\t-------------------------------");
System.out.println("\t Total Payment :"+actualPayment);
return actualPayment;
}
// ---------- PayrollProcessor.java --------------
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class PayrollProcessor {
private static List<Employee> employees = new ArrayList<>();
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int opt = 0;
do {
System.out.println("Choose operation : ");
System.out.println("1. Enter Technician Details.");
System.out.println("2. Enter Engineer Details.");
System.out.println("3. Enter Manager Details.");
System.out.println("4. Display Annual Payment Information.");
System.out.println("5. Exit.");
opt = Integer.parseInt(scanner.nextLine());
switch(opt) {
case 1 :
employees.add(getTechnicianDetails(scanner));
break;
case 2 :
employees.add(getEngineerDetails(scanner));
break;
case 3 :
employees.add(getManagerDetails(scanner));
break;
case 4 :
displayAnnualPaymentInformation();
break;
case 5 :
System.out.println("Exiting System....!");
return;
default :
System.out.println("Incorrect input ! Choose proper option.");
break;
}
} while (opt != 5);
scanner.close();
}
private static Technician getTechnicianDetails(Scanner scanner) {
Technician technician = new Technician();
System.out.print("First Name:");
technician.setFirstName(scanner.nextLine());
System.out.print("Last Name:");
technician.setLastName(scanner.nextLine());
System.out.print("Address:");
technician.setAddress(scanner.nextLine());
System.out.print("Telephone Number:");
technician.setTelephoneNumner(scanner.nextLine());
System.out.print("Social Security Number:");
technician.setSocialSecurityNumber(scanner.nextLine());
System.out.print("Monthly Payment:");
technician.setMonthlyPaymentRate(Double.parseDouble(scanner.nextLine()));
System.out.print("Over Time Hours:");
technician.setOvertimeHours(Integer.parseInt(scanner.nextLine()));
System.out.print("Over Time Rate:");
technician.setOvertimeRate(Double.parseDouble(scanner.nextLine()));
System.out.print("Technician Information Added Successfully..!\n\n");
return technician;
}
private static Engineer getEngineerDetails(Scanner scanner) {
Engineer engineer = new Engineer();
System.out.print("First Name:");
engineer.setFirstName(scanner.nextLine());
System.out.print("Last Name:");
engineer.setLastName(scanner.nextLine());
System.out.print("Address:");
engineer.setAddress(scanner.nextLine());
System.out.print("Telephone Number:");
engineer.setTelephoneNumner(scanner.nextLine());
System.out.print("Social Security Number:");
engineer.setSocialSecurityNumber(scanner.nextLine());
System.out.print("Monthly Payment:");
engineer.setMonthlyPaymentRate(Double.parseDouble(scanner.nextLine()));
System.out.print("Engineer Information Added Successfully..!\n\n");
return engineer;
}
private static Manager getManagerDetails(Scanner scanner) {
Manager manager = new Manager();
System.out.print("First Name:");
manager.setFirstName(scanner.nextLine());
System.out.print("Last Name:");
manager.setLastName(scanner.nextLine());
System.out.print("Address:");
manager.setAddress(scanner.nextLine());
System.out.print("Telephone Number:");
manager.setTelephoneNumner(scanner.nextLine());
System.out.print("Social Security Number:");
manager.setSocialSecurityNumber(scanner.nextLine());
System.out.print("Monthly Payment:");
manager.setMonthlyPaymentRate(Double.parseDouble(scanner.nextLine()));
System.out.println("Is he a excellent performer(Y/N):");
manager.setExcellentPerformer(scanner.nextLine().equalsIgnoreCase("Y"));
System.out.print("Manager Information Added Successfully..!\n\n");
return manager;
}
private static void displayAnnualPaymentInformation() {
for(Employee emp : employees) {
displayEmployeeInfo(emp);
}
}
private static void displayEmployeeInfo(Employee emp) {
System.out.println("First Name : "+emp.getFirstName());
System.out.println("Last Name : "+emp.getLastName());
System.out.println("Address : "+emp.getAddress());
System.out.println("Telephone Number : "+emp.getTelephoneNumner());
System.out.println("Social Security Number : "+emp.getSocialSecurityNumber());
System.out.println("Payment Information : "+ emp.calculateAtualPayment());
}
}
// Sample output




Design and implement an Employee Payment System using single inheritance. This system will support three types...
Within c++ Create a simple Employee class with name, department, and title. Create an hourlyEmployee class (which inherits from the Employee class) for a basic payroll program to compute the net pay salary of hourly based employees. Your program should also find the average net pay for a small company. To define the class, include the appropriate data members, member functions, constructors, and access modifiers. For simplicity, use a constant tax rate of 30% to compute the tax amount. Employees...
Requesting help with the following C Program: DESIGN and IMPLEMENT a menu driven program that uses the following menu and can perform all menu items: Enter a payroll record for one person Display all paycheck stubs Display total gross payroll from all pay records. Quit program The program will reuse the DATE struct from the previous assignment. You should also copy in the functions relating to a DATE. The program will create a PAYRECORD struct with the following fields: typedef struct...
c++ only Design a class representing an Employee. The employee would have at least these private fields (Variables): name: string (char array) ID: string (char array) salary: float Type: string (char array) All the variables except for the salary should have their respective setters and getters, and the class should have two constructors, one is the default constructor and the other constructor initializes the name,ID and type of employee with valid user input. The class should have the following additional...
Create a C++ project Create an Employee class using a separate header file and implementation file. The calculatePay() method should return 0.0f. The toString() method should return the attribute values ("state of the object"). Create an Hourly class using a separate header file and implementation file. The Hourly class needs to inherit from the Employee class The calculatePay() method should return the pay based on the number of hours worked and the pay rate. Remember to calculate overtime! Create a...
Concepts Tested in this Program: Class Design Constructors Objects Inheritance Program: Design a class named Person and its two subclasses, Student and Employee. Make Faculty and Staff subclasses of Employee. A Person object has a name, address, phone number, and email address (all Strings). A Student Object has a class status (freshman, sophomore, junior, or senior). Define the status as a final String variable. An Employee Object has an office number, salary (both ints ), and a date hired. Use...
The following needs to be in C programming ! Outcomes: Demonstrate the ability to design a menu driven program. Demonstrate the ability to reuse previous code to create a new assignment. Demonstrate the ability to use appropriate program logic. Program Specifications: DESIGN and IMPLEMENT a menu driven program that uses the following menu and can perform all menu items: Enter a payroll record for one person Display all paycheck stubs Display total gross payroll from all pay records. Quit program...
ASAP Please. Python Program Description Create an object-oriented program that allows you to enter data for employees. Specifications Create an abstract Employee class that provides private attributes for the first name, last name, email address, and social security number. This class should provide functions that set and return the employee’s first name, last name, email address, and social security number. This class has a function: get_net_income which returns 0. Create a Manager class that inherits the Employee class. This class...
Serendipity Engineering, Inc. Software Development Project Program Specifications: Serendipity Engineering, Inc. is a small engineering company located in a commercial park. The project manager wants you to develop a customer software package that will allow the company enter the customer information in the computer to keep a customer database. The software will perform the following tasks using menus: Enter Customer Information Display Customer Information Search Customer Information Organize (Sort) Customer Information Add, Delete, Modify, and Look Up Customer Records Save...
JAVA ONLY. For this assignment you will create an employee application, containing contact information, salary, and position. You will also define the type of company. Is it an engineering firm, a supermarket, or a call center? Once the application has been completed, I should be able to perform a query for any piece of information associated with each employee. For instance, if I search for employees who make over $50,000, all of the employees whose salaries are greater than $50,000 should...
Part (A) Note: This class must be created in a separate cpp file Create a class Employee with the following attributes and operations: Attributes (Data members): i. An array to store the employee name. The length of this array is 256 bytes. ii. An array to store the company name. The length of this array is 256 bytes. iii. An array to store the department name. The length of this array is 256 bytes. iv. An unsigned integer to store...