Guest User

Untitled

a guest
Feb 19th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. #include <stdio.h>
  2. int main()
  3. {
  4. int a,b,c,l,e,f,g,h,i,j,k;
  5. printf("please enter the pay code:1,2,3,4 or ctrl+z to end the program\n");
  6.  
  7. while ( (a=getchar() ) !=EOF)
  8. {
  9. switch(a)
  10. {
  11. case'1':
  12. printf("enter the weekly salary\n");
  13. scanf("%d",&b);
  14. printf("%d",b);
  15. break;
  16.  
  17. case'2':
  18. printf("enter the work of time\n");
  19. scanf("%d",&c);
  20. printf("enter the hourly wage\n");
  21. scanf("%d",&l);
  22. if (c>40)
  23. {
  24. e=40*l+(c-40)*l*2.5;
  25. printf("%d",e);
  26. }
  27. else
  28. {
  29. f=c*l;
  30. printf("%d",f);
  31. }
  32. break;
  33.  
  34. case'3':
  35. printf("enter the weekly sales\n");
  36. scanf("%d",&g);
  37. h=250+g*0.057;
  38. printf("%d",h);
  39. break;
  40.  
  41. case'4':
  42. printf("enter how many items do you have\n");
  43. scanf("%d",&i);
  44. printf("enter the money of the items\n");
  45. scanf("%d",&j);
  46. k=i*j;
  47. printf("%d",k);
  48. break;
  49. }
  50. }
  51. return 0;
  52. }
Add Comment
Please, Sign In to add comment