Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a C++ program with the following requirements(no pointers) Class Employee Member Variables (all private) variable Data Type Description FirstName String Contains the employees first

Create a C++ program with the following requirements(no pointers) Class Employee Member Variables (all private) variable Data Type Description FirstName String Contains the employees first name. LastName String Contains the employees last name. HoursWorked Double Contains the number of hours the employee worked. RegHourlyRate Double Contains the hourly rate of pay for regular hours worked (not overtime). OvertimeHourlyRate Double Contains the hourly rate of pay for overtime hours (hours worked over 40). Member Function Signatures and Descriptions (all public) Default constructor Default constructor. Sets the values of each member variable to default values. There are no parameters for this function. Note: Do not get values from the user inside this funcition. Get/Set methods Write get/set methods for all the member variables. Note: Do not get values from the user inside this function double GrossPay() Returns the gross pay for the employee. This calculation needs to take into account the overtime hours worked. For example, if the employee works 45 hours then the gross pay will consist of 40 hours worked at the regular pay rate plus 5 hours worked at the overtime rate. Note: It should not print anything. Do not get values from the user inside this fuction void Read(string filename) Reads all data from the given input file. This function must open an ifstream using the filename given in the formal parameter. See below for the layout of the file. Note: Do not get values from the user inside this fucntion void Write(string filename) Writes all data into the given output file. This function must open an ofstream using the filename given in the formal parameter. You must write the data according to the file format given below. Note: Do not write any descriptive text to the output file. there should only be one piece of data on each line in the outputfile Void Show() Writes all data from all member variables on standard output (the screen). This function should print descriptive text. See the sample execution below. Part II Console Application Create a C++ console application Main Function Specifications This function should show a menu to the user (description below) and take an action depending on what the user chooses to do. Required Variables - Declare one instance of type Employee inside main. You may also need other variables. Main Menu Loop - This program should show a menu to the user and take an action depending on what the user chooses to do. Here is the menu: Employee Program: 1. Read employee info from file 2. Write employee info to a file 3. Show employee info on screen 4. Show employee gross pay 5. Exit Menu Description Choice # Title Description 1 Read employee info from file Fill the Employee instance member variables with data from a file. You should ask the user to enter a filename and then read the data from the file that the user specified. Hint: You could use a member function of the Employee class to perform most of the work for this menu item. 2 Write employee info to a file Writes all the Employee instance member variable data to a file. You should ask the user to enter a filename and then write all the member variable data to the user specified file. Note: Do not write any descriptve text to the outputfile. There should only be one piece of data on each line. Hint: You could use a member function of the Employee class to perform most of the work for this menu item. 3 Show employee info on screen Write the contents of all member variables of the Employee instance to the screen (standard output). This function should contain descriptive text. See the sample execution below. Hint: You could use a member function of the Employee class to perform most of the work for this menu item. 4 Show employee gross pay Should display the gross pay for the employee on the screen. Hint: You could use a member function of the Employee class to perform most of the work for this menu item. 5 Exit the program. Employee Input File Format Employee Sample Input Data File (notice there is no descriptive text, just the data) Mark Anthony 45 250.00

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

Students also viewed these Databases questions

Question

30. Describe how symmetric encryption and decryption work.

Answered: 1 week ago