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
-
Find a basis for P which contains the set of polynomials { t ^ 2 + 1 . t - 1 } .
-
( a ) Let f and g be two functions defined from R - > R with f ( x ) = x 3 + 1 and g ( x ) = 3 x 1 . Find ( gof ) ( 1 ) , ( gof ) ( 2 ) and ( gof ) ( x )
-
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...
-
Your company has posted you on an eighteen-month overseas assignment in Budapest, Hungary. You will be living on the Buda side of the river, but will be spending much of your time on the Pest side....
-
Gallium has an orthorhombic structure with a0 = 0.45258 nm, b0 = 0.45186 nm, and c0 = 0.76570 nm. The atomic radius is 0.1218 nm. The density is 5.904 g/cm3, and the atomic weight is 69.72 g/mol....
-
Inland Equipment sells hand held engine analyzers to automotive service shops. Inland Equipment started April with an inventory of 85 units that cost a total of \($12,750.\) During the month, Inland...
-
Tungach Ltd make and sell a single product. Demand for the product exceeds the expected production capacity of Tungach Ltd. The holding of stocks of the finished product is avoided if possible...
-
2. What extrinsic and intrinsic cues would be used in assessing the perceived quality of AirAsia's company, and how would you as a consumer use extrinsic or intrinsic cues to improve the perceived...
-
If carbon dioxide is present in the atmosphere, then plants have a source of carbon. Hence, since plants have a source of carbon, carbon dioxide is present in the atmosphere. Use the counterexample...
-
4 points Jane Jones has applied for a mortgage loan from the Bank of Mississipp. The hark requested from you an appraisal of the property ining the sales comparison approach (points) Elements of...
-
Blockchain Company (BC) disposed of a machine they owned for cash. It originally cost BC $33,000. The accumulated depreciation at the date of disposal was $28,000. A gain on the disposal of $3,300...
-
Holding everything else constant, if consumers make 1,000 more trips to Disney World as their income increases by an average of $1,000 per household, can we: (a) conclude that trips to Disney World...
-
Find the analytic tan te=4+Pv. 37 co20-9 Coso +2.
-
For the modules to which students are assigned, they will complete the Sociology in the News assignment. The purpose of this assignment is to allow students to develop communication skills, retrieve...
-
Erik Erickson's life span theory states that middle adulthood is the stage of generativity versus stagnation. "Generativity is the ability to transcend personal interests to provide care and concern...
-
You buy an apartment. The cost is $500,000 and you must provide a deposit of $100,000. Ignore purchasing and transaction costs. Rates and maintenance will cost you $9,000 per year. Assume this cost...
-
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...
-
Through the implementation of efficient and effective management, New Belgium Brewing (NBB) has grown from operating out of the founder's basement to having two state-of-the-art facilities and over...
-
Define management and indicate what its principal purposes are and why managers are essential to organizations.
-
What are the resources of the organization? How are these used in management decision making?
Study smarter with the SolutionInn App