program not performing functions

I am writing a program to take a users input from the screen and calculate a tax amount  on the input. I compile my program with no errors and when run it and enter a price it does not calculate the amount. I have the tax amount coded and for some reason it picks the tax up as 0 and the calculation is not right. I have the code below. What am i doing wrong?


#include <stdio.h>
int main()
{      
/*     // declare variables here*/
//The first variables are each stores tax rate, Del Mar, Encinitas, La jolla
//The second variable is the purchase amount
//The third variable is the calculated tax rate
//The fourth variable is for user input of purchase amount
       float fDelMarTaxRate = 7.25;
       float fEncinitasTaxRate = 7.5;
       float fLaJollaTaxRate = 7.75;
       float fPurchaseAmount;
       float fDelMarSalesTax, fEncinitasSalesTax, fLaJollaSalesTax;
       float fpurchase;
       float fDelMarTotal;
       float fEncinitasTotal;
       float fLaJollaTotal;

//print message asking what the purchase amount is
    printf("What is the purchase amount?");

/*imput the answer into purchase*/
   scanf("%d,&fpurchase");


/*calculate the tax amount*/
   fDelMarSalesTax =((fDelMarTaxRate/100)*fpurchase);
   fEncinitasSalesTax = ((fEncinitasTaxRate/100)*fpurchase);
   fLaJollaSalesTax = ((fLaJollaTaxRate/100)*fpurchase);

 
/*calculate the total*/
   fDelMarTotal=(fpurchase+fDelMarSalesTax);
   fEncinitasTotal=(fpurchase+fEncinitasSalesTax);
   fLaJollaTotal=(fpurchase+fLaJollaSalesTax);

/* print the total*/
  printf("\n Del Mar Total %.2f\n"),fDelMarTotal;
  printf("\n Encinitas Total %.2f\n"),fEncinitasTotal;
  printf("\n La Jolla Total %.2f\n"),fLaJollaTotal;         
   
/*//     Return zero to confirm that the program ran*/
     return 0;
}
pgmtklAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Harisha M GEngineerCommented:
  scanf("%d,&fpurchase");

should be

   scanf("%f",&fpurchase);
0
pgmtklAuthor Commented:
Thanks. That still returns all the totals to the screen as 0.00. Is there something else i am missing? I am taking the scan purchase amount and calculate the tax amount, then adding that to the input purchase amount. It still gives me 0.00.
0
Harisha M GEngineerCommented:
Misplaced parenthesis:

  printf("\n Del Mar Total %.2f\n",fDelMarTotal);
  printf("\n Encinitas Total %.2f\n",fEncinitasTotal);
  printf("\n La Jolla Total %.2f\n",fLaJollaTotal);        
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

pgmtklAuthor Commented:
Thanks. I corrected that. But it still displays 0.00 for all 3 totals. DO i have the calculation coded wrong?
0
Harisha M GEngineerCommented:
This is working fine for me:


#include <stdio.h>
int main()
{      
/*     // declare variables here*/
//The first variables are each stores tax rate, Del Mar, Encinitas, La jolla
//The second variable is the purchase amount
//The third variable is the calculated tax rate
//The fourth variable is for user input of purchase amount
       float fDelMarTaxRate = 7.25;
       float fEncinitasTaxRate = 7.5;
       float fLaJollaTaxRate = 7.75;
       float fPurchaseAmount;
       float fDelMarSalesTax, fEncinitasSalesTax, fLaJollaSalesTax;
       float fpurchase;
       float fDelMarTotal;
       float fEncinitasTotal;
       float fLaJollaTotal;

//print message asking what the purchase amount is
    printf("What is the purchase amount?");

/*imput the answer into purchase*/
   scanf("%f",&fpurchase);


/*calculate the tax amount*/
   fDelMarSalesTax =((fDelMarTaxRate/100)*fpurchase);
   fEncinitasSalesTax = ((fEncinitasTaxRate/100)*fpurchase);
   fLaJollaSalesTax = ((fLaJollaTaxRate/100)*fpurchase);

 
/*calculate the total*/
   fDelMarTotal=(fpurchase+fDelMarSalesTax);
   fEncinitasTotal=(fpurchase+fEncinitasSalesTax);
   fLaJollaTotal=(fpurchase+fLaJollaSalesTax);

/* print the total*/
  printf("\n Del Mar Total %.2f\n",fDelMarTotal);
  printf("\n Encinitas Total %.2f\n",fEncinitasTotal);
  printf("\n La Jolla Total %.2f\n",fLaJollaTotal);        
   
/*//     Return zero to confirm that the program ran*/
     return 0;
}
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
pgmtklAuthor Commented:
Thank you so much. I have been stuck on this one item and when just compared the program I found my error. I had  misplaced the quotes on the scan input line. i had scanf("%f,&fpurchase"); instead of scanf("%f",fpurchase).  Thank you for your help.
0
Harisha M GEngineerCommented:
That's what I told in my first comment :)

Thanks
0
pgmtklAuthor Commented:
I must of overlooked that. I have been stuck on this one item. thanks again
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.