fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. string name;
  6. double salary;
  7. double payinc;
  8.  
  9. for(int loopcount = 0; loopcount <= 2; loopcount++) {
  10. cout << "What is your name? ";
  11. cin >> name;
  12.  
  13. cout << "What is your current Salary? ";
  14. cin >> salary;
  15.  
  16. cout << "What is your pay Increase? ";
  17. cin >> payinc;
  18. cout << endl;
  19.  
  20. double SalaryxInc = salary * payinc;
  21. double NewSal = salary + SalaryxInc;
  22. double monthlysal = NewSal / 12;
  23. double retrosal = (NewSal - salary) * 6/12;
  24.  
  25. cout << name << "'s SALARY INFORMATION" << endl;
  26. cout << "New Salary Monthly Salary Retroactive Pay" << endl;
  27. cout << NewSal << " " << monthlysal << " " << retrosal << endl << endl;
  28.  
  29. // --- PAUSE CODE ADDED HERE ---
  30. cout << "Press Enter to continue...";
  31. cin.ignore(); // Clears any leftover newline character from previous inputs
  32. cin.get(); // Waits for the user to press Enter
  33. cout << endl;
  34. }
  35.  
  36. return 0;
  37. }
Success #stdin #stdout 0.01s 5288KB
stdin
Jean Cyr 
80000
.05

Abe Lincon
5000
.07

Joe Jackson 
125125
.25

stdout
What is your name? What is your current Salary? What is your pay Increase? 
Jean's SALARY INFORMATION
New Salary     Monthly Salary      Retroactive Pay
0        0        0

Press Enter to continue...
What is your name? What is your current Salary? What is your pay Increase? 
Jean's SALARY INFORMATION
New Salary     Monthly Salary      Retroactive Pay
0        0        0

Press Enter to continue...
What is your name? What is your current Salary? What is your pay Increase? 
Jean's SALARY INFORMATION
New Salary     Monthly Salary      Retroactive Pay
0        0        0

Press Enter to continue...