Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Computer science c++ Need urgent Q1: Write a program that prompts the user to enter information about employees and stores information in a text file.

Computer science c++

Need urgent

image text in transcribed

image text in transcribed

Q1: Write a program that prompts the user to enter information about employees and stores information in a text file. The program should use polymorphism to create the appropriate employee objects. The program should then allow the user to save the employee records to a text file in append mode. Your code should be menu-driven and should prompt for entering employee's records until user decides to quit the program (See Snapshot). Read the saved information from text file and display the employee's records, your program should print out the employee name, ID, type and pay for each employee. The Employee class has following attributes and methods: - Employee name (string) - Employee ID (integer) - getName() function which will return name - getID0 function which will return ID - calculatePay() is a pure virtual function that must be implemented by derived classes. This function has no implementation in the base class, and its purpose is to allow each derived class to define its own version of the calculatePay0 function according to its specific pay calculation. There are three types of employees (derived classes): hourly, salary, and commission. Each employee type has different pay calculation methods: - Hourly employees are paid an hourly rate for the number of hours they work. Their record should also include the hourly rate (double) and the number of hours worked (double). - Salary employees are paid a fixed annual salary. Their record should also include the annual salary (double). - Commission employees are paid a base salary plus a percentage of their sales. Their record should also include the base salary (double) and the total sales (double). The percentage of commission depends on your SAP ID last digit. If your SAP ID last digit is 0 then the percentage of commission should be 0.5 otherwise it should be 0 .[SAP ID Last Digit] for example if SAP ID is 7037238 then the percentage of commission will be 0.8

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Statistical And Scientific Database Management International Working Conference Ssdbm Rome Italy June 21 23 1988 Proceedings Lncs 339

Authors: Maurizio Rafanelli ,John C. Klensin ,Per Svensson

1st Edition

354050575X, 978-3540505754

More Books

Students also viewed these Databases questions

Question

4. Identify cultural variations in communication style.

Answered: 1 week ago