Advertisement
Guest User

Untitled

a guest
Jan 19th, 2020
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.55 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. double getNetSalary(string tittle)
  6. {
  7. if (tittle == "stazysta")
  8. {
  9. return 1834;
  10. }
  11. else if (tittle == "kontraktowy")
  12. {
  13. return 1885;
  14. }
  15. else if (tittle == "mianowany")
  16. {
  17. return 2132;
  18. }
  19. else if (tittle == "dyplomowy")
  20. {
  21. return 2492;
  22. }
  23. else
  24. {
  25. return 0;
  26. }
  27. }
  28.  
  29. double getGrossSalary(string tittle)
  30. {
  31. if (tittle == "stazysta")
  32. {
  33. return 2538;
  34. }
  35. else if (tittle == "kontraktowy")
  36. {
  37. return 2611;
  38. }
  39. else if (tittle == "mianowany")
  40. {
  41. return 2965;
  42. }
  43. else if (tittle == "dyplomowy")
  44. {
  45. return 3483;
  46. }
  47. else
  48. {
  49. return 0;
  50. }
  51. }
  52.  
  53. double getNetSeniority(double netSalary, int years)
  54. {
  55. if (years >= 4)
  56. {
  57. return netSalary * years * 0.01;
  58. }
  59. else
  60. {
  61. return 0;
  62. }
  63. }
  64.  
  65. double getGrossSeniority(double grossSalary, int years)
  66. {
  67. if (years >= 4)
  68. {
  69. return grossSalary * years * 0.01;
  70. }
  71. else
  72. {
  73. return 0;
  74. }
  75. }
  76.  
  77. double getNetJubileeAward(double netSalary, int years)
  78. {
  79. double jubileeAward = 0;
  80.  
  81. if (years >= 20)
  82. {
  83. jubileeAward += netSalary * 0.75;
  84. }
  85.  
  86. if (years >= 25)
  87. {
  88. jubileeAward += netSalary;
  89. }
  90.  
  91. if (years >= 30)
  92. {
  93. jubileeAward += netSalary * 1.5;
  94. }
  95.  
  96. if (years >= 35)
  97. {
  98. jubileeAward += netSalary * 2;
  99. }
  100.  
  101. if (years >= 40)
  102. {
  103. jubileeAward += netSalary * 2.5;
  104. }
  105.  
  106. return jubileeAward;
  107. }
  108.  
  109. double getGrossJubileeAward(double grossSalary, int years)
  110. {
  111. double jubileeAward = 0;
  112.  
  113. if (years >= 20)
  114. {
  115. jubileeAward += grossSalary * 0.75;
  116. }
  117.  
  118. if (years >= 25)
  119. {
  120. jubileeAward += grossSalary;
  121. }
  122.  
  123. if (years >= 30)
  124. {
  125. jubileeAward += grossSalary * 1.5;
  126. }
  127.  
  128. if (years >= 35)
  129. {
  130. jubileeAward += grossSalary * 2;
  131. }
  132.  
  133. if (years >= 40)
  134. {
  135. jubileeAward += grossSalary * 2.5;
  136. }
  137.  
  138. return jubileeAward;
  139. }
  140.  
  141. int main()
  142. {
  143. string name;
  144. string tittle;
  145. int years;
  146.  
  147. cout << "Stopnie nauczyciela." << endl;
  148. cin >> name;
  149.  
  150. while (tittle != "stazysta" && tittle != "kontraktowy" && tittle != "mianowany" && tittle != "dyplomowy")
  151. {
  152. cout << "Prosze podac stopien awansu zawodowego dla " << name << " (stazysta, kontraktowy, mianowany, dyplomowy)." << endl;
  153. cin >> tittle;
  154. }
  155.  
  156. cout << "Ilość lat pracy" << name << "." << endl;
  157. cin >> years;
  158.  
  159. double netSalary = getNetSalary(tittle);
  160. double grossSalary = getGrossSalary(tittle);
  161. double netSeniority = getNetSeniority(netSalary, years);
  162. double grossSeniority = getGrossSeniority(grossSalary, years);
  163. double netJubileeAward = getNetJubileeAward(netSalary, years);
  164. double grossJubileeAward = getGrossJubileeAward(grossSalary, years);
  165.  
  166. cout << "Pensje podstawowe: " << netSalary << "zl. netto, " << grossSalary << "zl. brutto." << endl;
  167. cout << "Wysluga za lata pracy: " << netSeniority << "zl. netto, " << grossSeniority << "zl. brutto." << endl;
  168. cout << "Zarobek po przepracowanych latach: " << netSalary + netSeniority << "zl. netto, " << grossSalary + grossSeniority << "zl. brutto." << endl;
  169. cout << "Pensje podstawowe: " <<netJubileeAward << "zl. netto, " << grossJubileeAward << "zl. brutto." << endl;
  170.  
  171. system("pause");
  172. return 0;
  173. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement