/* tax.c by David Wallach (650) 493-1190 wallach@technologist.com */ #include #define RATE1 .27 #define RATE2 .39 void main() { /* The inclusion of a char is used for an added feature explained below */ char quit; float income, tax_amount; printf("What was your monetary intake last fiscal year? $"); scanf("%f",&income); if(income>25000) tax_amount=(10000*RATE1)+(income-25000)*RATE2; else if(income>15000) tax_amount=(income-15000)*RATE1; else (tax_amount=0); printf("Your total tax bill for the last fiscal year is $%.2f!",tax_amount); /* I added the section below because when I was running the program from windows9x, a DOS shell would open, but it would then close too quickly for me to see the results of the program. I am not sure if this is the correct syntax for what I am trying to do, but it seems to work. */ printf("\nWhen you are ready to quit, enter 'Y' "); scanf(" %c",&quit); quit=tolower(quit); if(quit=='y'); else(printf("Sorry, nothing else to do anyway...\n")); printf("Goodbye!"); }