Yes that was basically what I needed, I had corrected all the errors that was coming up, but then when I entered in a location, it stopped and went no further. Below is what I had corrected and I believe my problem started right after line 27.
I started out with taking out all the '}', because I believe that I had too many of those or they were in the wrong places. I actually wanted them to be able to enter another location if they wanted to, but somehow I messed on the coding and lost something along the way.Code:/* Kudler Food Tax Calculator */
//by Deborah Merry
//Calcaulate Sales Tax
//Class: POS370
//Date: July 2007
#include <stdio.h>//header
#include <ctype.h>//isdigit header
main(void)
{
float fCost;
int iResponse;
fCost=0;
iResponse=0;
//Program Header
printf ("\n\tKudler Fine Foods Sales Tax Calculator\n");
printf ("\n\tThank you for using the Kudler Tax Calculation Program.\n");
printf ("\n\tPlease select your location to receive your taxable total.\n");
printf ("\n 1\tDel Mar\n");
printf (" 2\tEncinitas\n");
printf (" 3\tLa Jolla\n");
printf("\n Please select your location (1-3): ");
for(;; 1=case 1:)
if (scanf("%d", &iResponse)==0)
break;
puts("Invalid number, please try again");
/* clear the input buffer */
while((iResponse = getchar()) != '\n' && iResponse != EOF)
switch (iResponse)
{
case 1:
printf("\n Welcome Del Mar Associate.\n");
printf(" Please enter your sub-total: $");
scanf("\n%f", &fCost);//sale sub-total
printf(" --------------------------------\n");
printf(" Your total tax is $%.2f\n", fCost * .0725);//in-line calculation
printf(" The total amount owed is $%.2f\n", fCost * (1+.0725));//in-line calculation
break;
getchar();
case 2:
printf("\n Welcome Encinitas associate.\n");
printf(" Please enter your sub-total: $");
scanf("%f", &fCost);//sale sub-total
printf(" --------------------------------\n");
printf(" Your total tax is $%.2f\n", fCost * .075);//in-line calculation
printf(" The total amount owed is $%.2f\n", fCost * (1+.075));//in-line calculation
break;
getchar();
case 3:
printf("\n Welcome La Jolla associate.\n");
printf(" Please enter your sub-total: $");
scanf("%f", &fCost);//sale sub-total
printf(" --------------------------------\n");
printf(" Your total tax is $%.2f\n", fCost * .0775);//in-line calculation
printf(" The total amount owed is $%.2f\n", fCost * (1+.0775));//in-line calculation
break;
getchar();
} // end calc
getchar();//keeps application viewable on screen
// end selection
}
