Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.01 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. float salary, serviceYears, salaryIncrease, salaryIncreasePercent, oldSalary, newSalary;
  8. cout << "Input \n" << endl;
  9. cout << "Enter Salary: ";
  10. cin >> salary;
  11. cout << "Years of Service: ";
  12. cin >> serviceYears;
  13. system("cls");
  14.  
  15. if (serviceYears <= 2)
  16. {
  17. cout << "Output \n" << endl;
  18. salaryIncreasePercent = 0;
  19. cout << "Salary: " << salary << " Pesos"<< endl;
  20. cout << "Years of Service: " << serviceYears << " Years"<< endl;
  21. salaryIncrease = salary * salaryIncreasePercent;
  22. cout << "Salary Increase: " << salaryIncrease << " Pesos"<< endl;
  23. cout << endl;
  24. oldSalary = salary;
  25. cout << "Old Salary: " << oldSalary << " Pesos"<< endl;
  26. newSalary = oldSalary + salaryIncrease;
  27. cout << "New Salary: " << newSalary << " Pesos"<< endl;
  28. }
  29.  
  30. else if (serviceYears <= 5)
  31. {
  32. cout << "Output \n" << endl;
  33. salaryIncreasePercent = 0.05;
  34. cout << "Salary: " << salary << " Pesos"<< endl;
  35. cout << "Years of Service: " << serviceYears << " Years"<< endl;
  36. salaryIncrease = salary * salaryIncreasePercent;
  37. cout << "Salary Increase: " << salaryIncrease << " Pesos"<< endl;
  38. cout << endl;
  39. oldSalary = salary;
  40. cout << "Old Salary: " << oldSalary << " Pesos"<< endl;
  41. newSalary = oldSalary + salaryIncrease;
  42. cout << "New Salary: " << newSalary << " Pesos"<< endl;
  43. }
  44.  
  45. else if (serviceYears <= 10)
  46. {
  47. cout << "Output \n" << endl;
  48. salaryIncreasePercent = 0.10;
  49. cout << "Salary: " << salary << " Pesos"<< endl;
  50. cout << "Years of Service: " << serviceYears << " Years"<< endl;
  51. salaryIncrease = salary * salaryIncreasePercent;
  52. cout << "Salary Increase: " << salaryIncrease << " Pesos"<< endl;
  53. cout << endl;
  54. oldSalary = salary;
  55. cout << "Old Salary: " << oldSalary << " Pesos"<< endl;
  56. newSalary = oldSalary + salaryIncrease;
  57. cout << "New Salary: " << newSalary << " Pesos"<< endl;
  58. }
  59.  
  60. else if (serviceYears <= 15)
  61. {
  62. cout << "Output \n" << endl;
  63. salaryIncreasePercent = 0.15;
  64. cout << "Salary: " << salary << " Pesos"<< endl;
  65. cout << "Years of Service: " << serviceYears << " Years"<< endl;
  66. salaryIncrease = salary * salaryIncreasePercent;
  67. cout << "Salary Increase: " << salaryIncrease << " Pesos"<< endl;
  68. cout << endl;
  69. oldSalary = salary;
  70. cout << "Old Salary: " << oldSalary << " Pesos"<< endl;
  71. newSalary = oldSalary + salaryIncrease;
  72. cout << "New Salary: " << newSalary << " Pesos"<< endl;
  73. }
  74.  
  75. else if (serviceYears <= 20)
  76. {
  77. cout << "Output \n" << endl;
  78. salaryIncreasePercent = 0.20;
  79. cout << "Salary: " << salary << " Pesos"<< endl;
  80. cout << "Years of Service: " << serviceYears << " Years"<< endl;
  81. salaryIncrease = salary * salaryIncreasePercent;
  82. cout << "Salary Increase: " << salaryIncrease << " Pesos"<< endl;
  83. cout << endl;
  84. oldSalary = salary;
  85. cout << "Old Salary: " << oldSalary << " Pesos"<< endl;
  86. newSalary = oldSalary + salaryIncrease;
  87. cout << "New Salary: " << newSalary << " Pesos"<< endl;
  88. }
  89.  
  90. else
  91. {
  92. cout << "OUT OF SERVICE";
  93. }
  94. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement