Question & Answer: Workers at a particular company were given a 15.5% salary increase. Moreover, the increase was retroactive for 2 months, that is…..

Workers at a particular company were given a 15.5% salary increase. Moreover, the increase was retroactive for 2 months, that is effective two months ago. Write a C++ program that takes the employee’s old salary as input and then output the amount of retroactive pay (balance) due to the employee and his new salary as well.

Don't use plagiarized sources. Get Your Custom Essay on
Question & Answer: Workers at a particular company were given a 15.5% salary increase. Moreover, the increase was retroactive for 2 months, that is…..
GET AN ESSAY WRITTEN FOR YOU FROM AS LOW AS \$13/PAGE

C++ Program:

#include <iostream>
#include <iomanip>

using namespace std;

//Constant declaration
const double HIKE = 15.5;

//Main function
int main()
{
double oldSalary, newSalary, retroActivePay;

cout << “nn Input employee old salary: \$”;
cin >> oldSalary;

//Calculating new Salary
newSalary = oldSalary + (oldSalary * (HIKE/100.0));

//Calculating retroactive pay for 2 months
retroActivePay = (newSalary – oldSalary) * 2;

cout << fixed << setprecision(2);

//Printing calculated values
cout << “nn Amount of retroactive pay (balance) due to employee: \$” << retroActivePay;
cout << “nn New Salary: \$” << newSalary << ” nn”;

return 0;
}

____________________________________________________________________________________________

Sample Output: