Advertisement
Guest User

Untitled

a guest
Mar 29th, 2020
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.  
  7. char id[10]; //right
  8. int hour, amtex; //right
  9. float salaryperhour, salaryperhourex, salary;
  10.  
  11. printf("The employees ID:"); //right
  12. scanf("%s", id);
  13.  
  14. printf("the hour worked:"); //right
  15. scanf("%d", &hour);
  16.  
  17. printf("the salaryperhour:"); //right
  18. scanf("%f", &salaryperhour);
  19.  
  20.  
  21. printf("the salaryperhourex:"); //right
  22. scanf("%f", &salaryperhourex);
  23.  
  24. salary = salaryperhour*hour;
  25.  
  26. printf("totalofsalary: $%.2f \n", salary);
  27.  
  28. if (hour >= 35)
  29. {
  30. amtex = hour - 35;
  31. salary = salaryperhour*hour + salaryperhourex*amtex;
  32. printf("totalofsalary: $%.2f ",salary);
  33. }
  34.  
  35. return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement