Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Three employees in a company are up for a special pay increase. Create a file named salaryInfo.txt that has data in the following format (but

Three employees in a company are up for a special pay increase. Create a file named salaryInfo.txtthat has data in the following format (but with different names and values):

Miller Andrew 65789.87 5 Green Sheila 75892.56 6 Sethi Amit 74900.50 6.1

Each input line consists of an employee's 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 $65,789.87, and the pay increase is 5% (or 0.05).

Write a program in RaiseCalculator.cpp that reads data from a specified file and stores the output in a new file. For each employee, the data must be output to a new file named salaryUpdated.txt in the following form: lastName firstName updatedSalary. Format the numerical output to two decimal places.

One example txt file needed for this problem is attached. Your code should not only work for this particular txt file, but also for any 3-line txt file in this format and named salaryInfo.txt. Create multiple txt input files (salaryInfo1.txt, salaryInfo2.txt, etc.) to be used to test your code (rename them to salaryInfo.txt to test them). Make them only 3 lines in length and similar in format to the example txt file. Rework your code as needed.

Create a testResults.txt with a short paragraph explaining the results of your tests and if/how you changed your code after testing.


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