Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int a,b,c,l,e,f,g,h,i,j,k;
- printf("please enter the pay code:1,2,3,4 or ctrl+z to end the program\n");
- while ( (a=getchar() ) !=EOF)
- {
- switch(a)
- {
- case'1':
- printf("enter the weekly salary\n");
- scanf("%d",&b);
- printf("%d",b);
- break;
- case'2':
- printf("enter the work of time\n");
- scanf("%d",&c);
- printf("enter the hourly wage\n");
- scanf("%d",&l);
- if (c>40)
- {
- e=40*l+(c-40)*l*2.5;
- printf("%d",e);
- }
- else
- {
- f=c*l;
- printf("%d",f);
- }
- break;
- case'3':
- printf("enter the weekly sales\n");
- scanf("%d",&g);
- h=250+g*0.057;
- printf("%d",h);
- break;
- case'4':
- printf("enter how many items do you have\n");
- scanf("%d",&i);
- printf("enter the money of the items\n");
- scanf("%d",&j);
- k=i*j;
- printf("%d",k);
- break;
- }
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment