Answered step by step
Verified Expert Solution
Question
1 Approved Answer
J Inc. has a file with employee details. You are asked to write a C++ program to read the file and display the results with
J Inc. has a file with employee details. You are asked to write a C++ program to read the file and display the results with appropriate formatting. Read from the file a person's name, SSN, and hourly wage, the number of hours worked in a week, and his or her status and store it in appropriate vector of obiects. For the output, you must display the person's name, SSN, wage, hours worked, straight time pay, overtime pay, employee status and net pay. Pay calculations and output display should be carried out using functions. For full-time employees, $10 is deducted from wages for union fees. A person is full-time if the status is F. Time and a half is paid for any time worked over 40 hours in a week. Make sure the output is formatted into rows and columns and includes the appropriate titles and column headings. Additional requirements: 1) Define a class Employee with appropriate member variables and the following member functions: a. Two constructors: /I constructor that takes five parameters Employee(string theName, string theSsn, double theHourlywage, double theHoursWorked, char theStatus); // default constructor Employee(); b. Appropriate accessors and mutators. Make all accessors and mutators inline functions c. calculatePay0 and displayEmployee0 should also be member functions of class Employee. Eor all the member functions.use const modifier whereverappropriate. 2) Define a vector of Employee objects in main0. Handle the file reading properly, and use constructor to set values for each Employee object
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started