Advertisement
Guest User

Untitled

a guest
May 5th, 2013
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string>
  3.  
  4. int main () {
  5. int age;//Age of Employee at time of severance//
  6. int FOS;//Number of complete years of service done by Employee by time of severance//
  7. char gender;//Is the Employee Male or Female (M/F)?//
  8. float salary;//How much the Employee earns per annum at the time of severance//
  9. float sevPay;//How much severance payment the Employee is entitled to//
  10.  
  11. {
  12. printf ("Is the Employee Male or Female?\n");
  13. scanf ("%c"&gender);
  14. printf ("Please enter the Employee&#x27;s Age (at the time of severance.\n");
  15. scanf ("%i",&age);
  16. printf ("Please enter the Employee&#x27;s Annual Salary (at the time of severance).\n)";
  17. scanf ("%f",&salary);
  18. printf ("Please enter how many complete years of service the Employee has carried out by the time of severance?\n");
  19. scanf ("%i",&FOS);
  20. }
  21.  
  22. if (gender ==&#x27;M&#x27; && age >= 45) {
  23. sevPay=((salary/52)*2)* FOS;
  24. }
  25.  
  26. if (gender==&#x27;M&#x27; && age <45) {
  27. sevPay=(salary/52)*FOS;
  28. }
  29.  
  30. if (gender==&#x27;F&#x27; && age >= 40) {
  31. sevPay=((salary/52)*2)* FOS;
  32. }
  33.  
  34. if (gender==&#x27;F&#x27; && age < 40) {
  35. sevPay= (salary/52)*FOS;
  36. }
  37.  
  38. printf ("The Severance Payment the Employee is entitled to is £\n)";
  39. scanf ("%f"&sevPay);
  40.  
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement