Create the program based on the following specifications: The program will accept employee data and display...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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. 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.
Expert Answer:
Answer rating: 100% (QA)
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 the full answer
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Posted Date:
Students also viewed these programming questions
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
Listed below are the genders of the younger winner in the categories of Best Actor and Best Actress for recent and consecutive years. Do the genders of the younger winners appear to occur randomly? F...
-
A typical gamma ray emitted from a nucleus during radioactive decay may have an energy of 300keV. What is its wavelength? Would we expect significant diffraction of this type of light when it passes...
-
Refer to the bond details in Problem. In Problem, Kelly issues $315,000 of 4%, 15-year bonds dated January 1, 2009, that pays interest semiannually on June 30 and December 31. They are issued at...
-
Copy your worksheet from Question 6 into another worksheet. Change the increase from 10% to 18%. Protect the worksheet, so that changes cannot be made. Question 6 Open a new spreadsheet. Type...
-
McBride Company has the following opening account balances in its general and subsidiary ledgers on January 1 and uses the periodic inventory system. All accounts have normal debit and credit...
-
he accounts from the Adjusted Trial Balance are listed in alphabetical order. What is the total longminusterm liabilities? Baker Service Company Adjusted Trial Balance September 30, 2025 Balance...
-
Amfac Company manufactures a single product. The company keeps careful records of manufacturing activities from which the following information has been extracted: The companys manufacturing overhead...
-
Hugo Sports Equipment Limited (HSEL), a Swedish manufacturer of tennis equipment, is considering the purchase of equipment for their new racquet line. You work in the finance department and must...
-
Purchase Considerations Borrow $1.6 million at 10 percent on declining balance Depreciate stratight line over five years Trade-in value of $130,000 at end of useful life Maintenance expense of...
-
If 8(n) is a unit-impulse, using the definition of convolution, show that x(n)* 8(n-k) = x(n-k) (for an arbitrary signal x(n). Assume the impulse response of an LTI system is given by: h(n) = {1, 2,...
-
Continuous improvement violates which regression analysis assumption? Multiple choice question. The errors in estimating the costs are independent of the cost drivers. The errors in estimating the...
-
Design a program that generates at random a series of 20 numbers in the range of 1 through 100. The program should store the numbers in a list and then display the following data: The lowest number...
-
1. Based on both your own experiences and what you've learned, what is YOUR definition of marketing? (Feel free to note how the text, our discussions in class, the book you're reading or research...
-
Given that f ( n ) is a function for all non-negative integers n , find f (2) , f (3) , and f (4) for each of the following recursive definitions: a) f (0) = 1 f ( n + 1) = 2 f ( n ) 2 + 2 b) f (0) =...
-
For the following exercises, find the area of the triangle. Round to the nearest hundredth. 22 50 36
-
What does the following fragment of code display? What do you think the programmer intended the code to do, and how would you fix it? int product = 1; int max = 20; for (int i = 0; i
-
Write a program that will read a text file that contains an unknown number of movie review scores. Read the scores as Double values and put them in an instance of ArrayList. Compute the average score.
-
Define DiscountPolicy as an interface instead of the abstract class described in Exercise 10. Exercise 10. Create an abstract class DiscountPolicy. It should have a single abstract method...
-
Starting with Eq. (4.62), derive Eq. (4.63). Data From Equation (4.62) Data From Equation (4.63)
-
You want to design a side looking synthetic aperture ultrasonic radar operating at f0 = 60 KHz and peak power Pt = 2 W. The antenna beam is conical with 3dB beam width 3dB = 5. The maximum gain is...
-
In reference to Figure 4.18, assume a radar height of \(h_{r}=100 \mathrm{~m}\) and a target height of \(h_{t}=500 \mathrm{~m}\). The range is \(R=20 \mathrm{~km}\). (a) Calculate the lengths of the...
Study smarter with the SolutionInn App