#include <iostream> // required to perform C++ stream I/O
#include <iomanip> // required for parameterized stream manipulators
using namespace std; // for accessing C++ Standard Library members
// function main begins program execution
int main(){
double wage = 0, raise = 0, raiseMoney = 0;
int years = 0;
// Prompt user to enter weekly wage
cout << "Enter starting weekly wage: ";
cin >> wage;
// Prompt user to enter amount of raise
cout << "Enter amount of raise (in %): ";
cin >> raise;
// Prompt user to enter years of employment
cout << "Enter years of employment: ";
cin >> years;
wage = wage * 52;
raiseMoney = (raise / 100) * wage;
cout << setprecision(2) << fixed;
cout << "\nYear Annual Salary\n";
for(int i = 0 ; i < (years) ; i++)
{
cout << (i+1) << " $" << wage + (raiseMoney * i) << "\n";
}
cout << endl;
return 0;
The numbers are not adding up correctly: Can someon just check out the code and tell me what I am missing or did wrong, This is what it is supposed to print.
Year Annual Salary
1 26000.00
2 26780.00
3 27583.40
4 28410.90
5 29263.23
6 30141.13
7 31045.36
8 31976.72
Press any key to continue....
Any Help would be appreciated!!!