Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The following employees in a company are up for a special pay increase. You are given a file, say EmployeeData.txt, with the following data: Miller

The following employees in a company are up for a special pay increase. You are given a file, say EmployeeData.txt, with the following data:

Miller Andrew 65789.87 5

Green Sheila 75892.56 6

Sethi Amit 74900.50 6.1

Hooks Alex 66345.45 7.2

Miller Maria 75345.50 6.7

Harrison Marga 80450.95 5.5

Each input line consists of an employees last name, first name, current salary, and percent pay increase. For example, in the first input line, the last name of the employee is Miller, the first name is Andrew, the current salary is 65789.87, and the pay increase is 5%.

- Write a C++ program that reads data from the specified file and stores the output in the file EmployeeOutput.dat. If the percent pay increase is greater than or equal to 6%, then add $1000.00 to the updated salary.For each employee, the data must be output in the following form:firstNamelastName updatedSalary.Format the output of decimal numbers to two decimal places.Make sure you use a while loop to read until EOF.Your program should work if I change the number of lines in the input file.Your program should also be able to handle a case where the final line of the file is empty, a common error here is that you will read and process the last real line of data twice! Please include comments and a screenshot of the output

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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