I am writing this program in C to figure tax for 3 stores with 3
different tax percents. It is my first program and is an assignment.
All I need is some direction. NOT THE ANSWER. The program gives this
error. c:\miracle c\examples\taxcalcprog.c: line 13: Parse Error,
expecting `SEP'
'float fTotal1 float fTotal2 float fTotal3 iResponse = 0'
I think I might have the functions incorrect. I am not sure if I need
braces around each one or if I need to nest the if then statements.
The class is not a programming class. If you could point me in the
general direction I will work on it. If I am totally lost tell me
that also.
Here is the code:
/*original version*/
#include <stdio.h>
main()
{
/*setting variables for store choice*/
int iResponse;
float fSales;
float fTax1;
float fTax2;
float fTax3;
float fTotal1
float fTotal2
float fTotal3
/*initializing variables*/
iResponse = 0;
fSales = 0;
fTax1 = .0725;
fTax2 = .075;
fTax3 = .0775;
fTotal1 = fTax1 * fSales
fTotal2 = fTax2 * fSales
fTotal3 = fTax3 * fSales
/*function for selecting store location*/
printf ("\n\tStore location");
printf ("\n1\t Del Mar\n");
printf ("\n2\t Encinitas\n");
printf ("3\t La Jolla\n");
printf ("\nEnter the number of your store location: ");
scanf (""%d"' &iResponse);
/*function for inputing sales*/
printf ("\nEnter amount of purchase:");
scanf ("%f", &fSales);
/*function for conditions*/
if (iResponse ==1)
printf ("\nYour tax is", fTax1 * fsales);
printf ("\nYour total is", fTotal1);
if (iResponse ==2)
printf ("\nYour tax is", fTax2 * fsales);
printf ("\nYour total is", fTotal2
if (iResponse --3)
printf ("\nYour tax is", fTax3 * fsales);
printf ("\nYour total is", fTotal3);
if (iResponse > 3)
printf ("\nYour choice has to be 1,2 or 3\n");
}