Workers at a particular company have won a 7.6% pay increase retroactive for six months. Write a program that takes an employee’s previous annual salary as input and outputs the amount of retroactive pay due the employee, the new annual salary, and the new monthly salary. Use a variable declaration with the modifier const to express the pay increase.
#include <iostream>
using namespace std;
int main()
{
double oldSalary, retroSalary, newSalary, increaseSalary, newMonthlySalary;
const double payIncrease = .076;
cout << "Enter your old annual salary." << endl;
cin >> oldSalary;
newSalary = (oldSalary * .076) + oldSalary;
increaseSalary = newSalary - oldSalary;
newMonthlySalary = newSalary / 12;
retroSalary = (oldSalary / 2) * payIncrease;
cout << endl;
cout << "Your new annual salary is: $" << newSalary << endl;
cout << "You received a $" << increaseSalary << " increase in salary." << endl;
cout << "You will receive $" << retroSalary << " in retroactive salary." << endl;
cout << "Your new monthly salary is: $" << newMonthlySalary << endl;
return 0;
}