1. I need HELP

I know that all of you are tired of hearing of so many of us working on code for class.

I have got everything coded, but it is not working. I am using 'C', and using Mirace C and the editor.

Below is the code if someone would like to help me.

Code:
```/* Kudler Food Tax Calculator */
//by Deborah Merry
//Calcaulate Sales Tax
//Class: POS370
//Date: July 2007

#include <stdio.h>

main(void)
{

//Declare Variables
float	fsubtotal, taxdelmar, taxencinitas, taxlajolla;
float fCost;//calculation operator
fCost = 0;

fsubtotal=125.00;

//variables
/*Taxtotal=Subtotal*Taxrate*/
taxdelmar=.0725;
taxencinitas=.0775;
taxlajolla=.0750;

printf("\n\tKudler Fine Foods 'Sales Tax Calculator'\n");

{//start
int iResponse = 0;

/* clear the input buffer */
while((iResponse = getchar()) != '\n' && iResponse != EOF);
}

{

printf("\n Welcome Del Mar Associate.\n");
scanf("\n&#37;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();

}
{
printf("\n Welcome Encinitas associate.\n");
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();
}
{

printf("\n Welcome La Jolla associate.\n");
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

}```

2. you put return 0; at the end
but it is not working.
how?

3. i doubt anyone, including myself, will look through your code, decide what it does, then decide where the problem lies, and then finally give you the answer.

tell us what your program does, or at least what specifically 'is not working'. give us any ideas why you think it may not be working or other methods you have tried to solve the problem.

4. The most important part of your post was left out. Try telling us what the program is supposed to do. Then tell us what it is actually doing.

Edit: Man, beat by two others. I must be getting old.

5. Not working

Sorry everyone, I was in a hurry and did not take the time to think.

I actually have the code working like it should, we are just required now to validate the user's input.

Since I am tired, I am not putting the correct statement syntax in, for it to work correctly

6. > I am using 'C', and using Mirace C and the editor.
The first thing to do is get a real compiler, not some nagware which fell out of a cereal packet as a 'free' gift.
Miracle 'C' is utterly useless as a modern compiler. It fails in such bizarre ways on even the simplest of programs.

Try something like dev-c++.

7. MacGyver, I apologize in asking for help with my "Homework". I decided late in life to start getting my degree, after I had my divorce and right now, I am just tired. Hopefully I will not have to bother anyone again.

The way I see it, it is better late than never to get a degree and to obtain knowledge. Again I do apologize in asking for any assistance.

8. Salem,

Thanks, this was what the school had us download, I do have the Dev-c++ and I like it better because you can actually read where the error is, not that this helps fix, but it does help the whole process......

9. Originally Posted by startingover
I actually have the code working like it should, we are just required now to validate the user's input.
check the return value of scanf.

http://cppreference.com/stdio/scanf.html

10. You seem to have lots of braces, yet no program 'logic' which would make use of them.

Are you supposed to be adding some kind of menu system, then making some choices to run the various bits of the code?

I'm shocked.
If whoever is teaching doesn't realise this is a broken compiler, I fear you won't learn much from them.

11. Thank you

I had actually written my code, I was just trying to really get some expert opinions on if I had done things correctly. I really like do things on my own, but always take into consideration those who are more experienced than I am.

Thank you all for your enormous help and assistance. I know that I am on own, as it should be.

12. MacGyver, I apologize in asking for help with my "Homework". I decided late in life to start getting my degree, after I had my divorce and right now, I am just tired. Hopefully I will not have to bother anyone again.
Dont worry about that. Its his signature. Its not specifically directed at you.

Code:
`main(void)`
Should really be:
Code:
`int main(void)`
Also I'm not sure if theres a reason for it, I don't know all that much about C, but you seem to have a lot of unnecessary opening/closing braces in your code.

13. Originally Posted by mike_g
Dont worry about that. Its his signature. Its not specifically directed at you.
Indeed, it's just a signature meant for those that ask us to do their homework for them, not asking for help. It's attached to all of my posts, since that's how forum signatures work.

I had absolutely no problem with this topic whatsoever except for what I explicitly stated: I felt the description of the problem was lacking, and therefore, it would be best to ask what the problem was instead of guessing. It was not a statement against the topic starter.

14. My Work

I definitely do not want anyone to do my homework for me, I do not learn that way. If I cannot learn, then there is no point in going to school in the first place. I guess that I thought that an expert, more than I am could look at what I did and guide me in the right direction to see what I have done and why it would not excute correcly.

I have 3 locations, so the user needs to input their location and the amount of the sale and then it would come up with the tax and add it to the total.

I could not get my closing correct for some reason and it is probably because I have everything too spread out. I need to clean it up some and it may work just fine. I hope so.

15. Looking at you code it as if you were trying to do a conditional check. Does this do what you want?
Code:
```#include <stdio.h>

int main(void)
{
//Declare Variables
float fsubtotal, taxdelmar, taxencinitas, taxlajolla;
float fCost;//calculation operator
int iResponse = 0;

fCost = 0;
fsubtotal=125.00;
taxdelmar=.0725;
taxencinitas=.0775;
taxlajolla=.0750;

printf("\n\tKudler Fine Foods 'Sales Tax Calculator'\n");
printf("Chose a number between 1 and 3\n");

//Repeatedly get input until a number between 1 and 3 is entered
while(iResponse <= 0 || iResponse > 3)
scanf("%i", &iResponse);

if(iResponse ==1)
{
printf("\n Welcome Del Mar Associate.\n");
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
}
else if(iResponse ==2)
{
printf("\n Welcome Encinitas associate.\n");
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
}
else
{
printf("\n Welcome La Jolla associate.\n");