#include<stdio.h>#defineOVERTIME40#defineRATE1.5#defineFIRST300#defineSECOND450#defineTAXRATE10.15#defineTAXRATE20.2#defineTAXRATE30.25intmain(void){int hour,level;double salary,tax;double HOURWAGE;printf("Enter tne number corresponding to the desired pay rate or action:\n");printf("1)$8.75/hr 2)$9.33/hr\n");printf("3)$10.00/hr 4)$11.20/hr\n");printf("5)quit\n");scanf_s("%d",&level);while(level!=5){switch(level){case1:
HOURWAGE=8.75;break;case2:
HOURWAGE=9.33;break;case3:
HOURWAGE=10;break;case4:
HOURWAGE=11.2;break;default:printf("请输入1—4数字,以5结束!\n");break;}printf("请输入您的工作小时数:");scanf_s("%d",&hour);if(hour<=OVERTIME){
salary=hour*HOURWAGE;}else{
salary=OVERTIME*HOURWAGE+(hour-OVERTIME)*RATE*HOURWAGE;}if(salary<FIRST){
tax=salary*TAXRATE1;}elseif(salary<SECOND){
tax=FIRST*TAXRATE1+(salary-FIRST)*TAXRATE2;}else
tax=FIRST*TAXRATE1+(SECOND-FIRST)*TAXRATE2+(salary-SECOND)*TAXRATE3;printf("\n您的工资总额为%.2lf,税金为%.2lf,净工资为%.2lf。\n",salary,tax,salary-tax);printf("Enter tne number corresponding to the desired pay rate or action:\n");printf("1)$8.75/hr 2)$9.33/hr\n");printf("3)$10.00/hr 4)$11.20/hr\n");printf("5)quit\n");scanf_s("%d",&level);}}