1. ## Student Question3

Ok Guy's,
I am having a major brain freeze here. Here is my code:

Code:
```#include<stdio.h>
#include <stdlib.h>
int main (void)

{
//declaring variables
float Purchase_Amount = 0.0; //Variable for the purchase amount initialized at 0
float DelMar_TaxRate = 7.25; //Del Mar Tax Rate
float Encinitas_TaxRate = 7.50; //Encinitas Tax Rate
float LaJolla_TaxRate = 7.75; //La Jolla Tax Rate

//Welcome Screen
printf("Kudler Fine Foods Tax Calculation Program\n");
if(scanf_s("%f", &Purchase_Amount) !=1) //Error Check and Message
{
printf(" That was an Invalid Purchase Amount. Please try again. Example 99.99, enter Zero to exit\n");
}

//Calculations For each location//
//TotalAmount  = PurchaseAmount * DelMarTaxRate / 100.00 + PurchaseAmount
printf("\nThe Del Mar Tax Rate of 7.25%% adds \$%2.2f", DelMar_TaxRate * Purchase_Amount);
printf(" for a \ntotal of ---------> \$%.2f.\n", (DelMar_TaxRate * Purchase_Amount)+Purchase_Amount/100.00);
printf("\nThe Encinitas Tax Rate of 7.50%% adds \$%2.2f", Encinitas_TaxRate * Purchase_Amount);
printf(" for a \ntotal of ---------> \$%.2f.\n", (Encinitas_TaxRate * Purchase_Amount)+Purchase_Amount/100.00);
printf("\nThe La Jolla Tax Rate of 7.75%% adds \$%2.2f", LaJolla_TaxRate * Purchase_Amount);
printf(" for a \ntotal of ---------> \$%.2f.\n", (LaJolla_TaxRate * Purchase_Amount)+Purchase_Amount/100.00);
printf("\n\n\tThank you and have a nice day!\n\n");
return 0;
}```
Everything but the math is right. If I input \$100.00, I get \$725.00 when I should be recieving back \$107.25.

Thanks...

2. it's supposed to be 7.25% tax plus the 100 you spent

so
(DelMar_TaxRate * Purchase_Amount)+Purchase_Amount/100.00)

supposed to be

((DelMar_TaxRate / 100) * Purchase_Amount) + Purchase_Amount)

3. Originally Posted by jh0720
it's supposed to be 7.25% tax plus the 100 you spent

so
(DelMar_TaxRate * Purchase_Amount)+Purchase_Amount/100.00)

supposed to be

((DelMar_TaxRate / 100) * Purchase_Amount) + Purchase_Amount)
Awesome!!! I should have seen this but thank you!!!