Question: Create the program based on the following specifications: The program will accept employee data and display the bonus. It will also employ dictionaries and

Create the program based on the following specifications: The program will accept employee data and display  
 
 
 
Create the program based on the following specifications: The program will acceptemployee data and display the bonus. It will also employ dictionaries andFile input and output. The program will also be utilizing classes andinheritance. 1. At the start of the program the following will be 


 
 
 

Create the program based on the following specifications: The program will accept employee data and display the bonus. It will also employ dictionaries and File input and output. The program will also be utilizing classes and inheritance. 1. At the start of the program the following will be displayed. The user will input data about the employee. yet... You have no record Enter the employee number: 101 Enter the employee name: Johnny Enter the employee salary: 15000 Note: The no records yet means the program will read the text file. If the text file does not exists yet, the message "You have no records yet.. " will be displayed. 2. The user will then be prompted to choose whether the employee is salaried or part-time. It will then display the following data: You have no record yet.... Enter the employee number: 101 Enter the employee name: Johnny Enter the employee number: 101 Enter the employee name: Johnny Enter the employee salary: 15000. Note: The no records yet means the program will read the text file. If the text file does not exists yet, the message "You have no records yet.. " will be displayed. I 2. The user will then be prompted to choose whether the employee is salaried or part-time. It will then display the following data: You have no record yet.... Enter the employee number: 101 Enter the employee name: Johnny Enter the employee salary: 15000 Enter the type of employee. S for salaried, P for Partime S Employee empno: 101 Employee name Johnny Employee salary 15000 The bonus of the employee is 3000.0 3. The bonus is computed as follows: For Salaried it is 20% of the salary and for part-timers it is 10% of the salary. 4. The program will then prompt the user if he or she wants to enter more employees. If yes, the program will begin again. You have no record yet... Enter the employee number: 101 Enter the employee name: Johnny Enter the employee salary: 15000 Enter the type of employee. S for salaried, P for Partime S Employee empno: 101 Employee name Johnny Employee salary 15000. The bonus of the employee is 3000.0 Do you want to enter more employee ? Type y for yes and n for no y Enter the employee number: 102 Enter the employee name: Josie Enter the employee salary: 20000 5. If no, the program will display all the previous data. Do you want to enter more employee 7 Type y for yes and n for no n You have 3 employee records 4 Employee Number 101 Employee Name Johnny Employee Salary 15000 Employee Type S Employee Number 102 Employee Name Josie Employee Salary 20000 Employee Type P Employee Number 105 Employee Name Jackie Employee Salary 15000. Employee Type P 6. The next time the program is opened. It will also display the saved data. Example: TH Employee Name Jackie Employee Salary 15000. Employee Type P 6. The next time the program is opened. It will also display the saved data. Example: You have 2 employee records Employee Number 101 Employee Name Johnny Employee Salary 15000 Employee Type S Employee Number 102 Employee Name Josie. Employee Salary 20000 Employee Type P Enter the employee number: 105 Enter the employee name: Jackie Enter the employee salary: 15000 Enter the type of employee. S for salaried, P for Partime P 2 18 Code Design Requirements 1. You will create 3 classes: Employee, Salaried and Parttime 2. The employee class will have the following specifications: a. A constructor that will initialize the employee number, name and salary. b. Getters and setters' methods for your instance variables. c. A display method that will display the contents of the instance variables. 3. The Salaried class will have the following specifications: a. It will inherit from the employee class. b. It will have its own constructor that will supply the needs of the parent class and initialize its own instance variable which is the bonus. c. It will have a method that will compute bonus of a salaried employee. Bonus is 20% of the salary. d. It will override the display method of the parent class by calling the original display method and adding a statement that will print the bonus of the employee. 4. The Parttime class will have the following specifications. a. It will inherit from the employee class. b. It will have its own constructor that will supply the needs of the parent class and initialize its own instance variable which is the bonus. c. It will have a method that will compute bonus of a salaried employee. Bonus is 10% of the salary. d. It will override the display method of the parent class by calling the original display method and adding a statement that will print the bonus of the employee.

Step by Step Solution

3.38 Rating (154 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres a Python program that meets your specifications It allows you to input and manage employee data including bonuses for both salaried and parttime ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!