• C

Simple calculating programs

Can somone create this request for me please: i need to see how it works

Service Request SR-kf-008
Tax Calculator

Organization:  Kudler Fine Foods
Locations:        All
Requester:      Harvey Stephens

Description of Request:
Create a tax calculation program for Kudler stores.

Background of Request:
Some food items and all non-food items are subject to a statewide sales tax and local district taxes. Due to differences in district taxes, each store uses a different tax rate.
•      Del Mar - 7.25%
•      Encinitas - 7.5%
•      La Jolla - 7.75%

Expected Results/Impact when completed:
C program that displays the sales tax amount for each store location for a purchase amount of $125.00.

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.

Hi Eaddy,

This is not a place to get people to do your homework for you. If you have a problem with a specific piece of C code, we'll help, but we won't do all the work for you.

EaddyAuthor Commented:
its not my home work. but true it is home work
and i am trying to get the kid to undersatnd
what i need is to know how this thing works so i can explain i!! nothing more nothing less
Well you wanto explaine something you yoursel does not understand. That will be an interesting outcome.

Now let's see
How can we calculate one tax. We just take the amount and then we either

multiply it by the tax rate and or we divide it with 1 + tax rate if the tax is include.

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.

<Source code removed by Page Editor>
Prashant SabnekarAVPCommented:
I advise you to start it and ask us if you find any problem, we are allways here.

Prashant Sabnekar
EaddyAuthor Commented:
The first time I came to this site and asked about C/C++ was in 1998.  And by doing so I got some books on the topic but my interest in it did not last. Now around 8 years I am ask to help a kid with there homework not remembering how its done but by looking at the question I felt sure it was entry level coding and as long as I found out how it was done I would be able to explain it to another. If I had thought this would get so many people into an argument I would have never posted it.

To the admin::

If you feel this question is not in keeping with the rules of your site please delete it as I do not think I have the option to do so.

Thank you all for your time.

If anyone was upset by anyone’s comment please do not take it to heart and just let it go.

I thank everyone for there time again. And to you all please take care!

Best Regards

You have not done wrong. We help with homework and I personally actively encourage helping with homework questions. Please do not be put off by the 'discussion' that is going on here. You will be helped with your problem despite the difficulties.

We have to tread a fine line when it comes to this sort of question. As I pointed out to tarcis, students often believe that pretending that their question is not homework will help them get the help they believe they need. In view of this we have a policy of not posting full-code solutions to questions that even might be homework. Experts sometimes need to be reminded of this.

I hope you can ignore the off-topic posts and let us help you.


Tax calculation, in most countries, is a simple process of adding a percentage of the original amount to the total, just like on your calculator. Here, however, you would need to keep a table of percentages, one for each area, containing the percentage to use. At its most simpel form, this table need not actually be in the form of data but can be code in the form of a switch statement such as:

switch ( area )
 case DelMar:
      rate = 7.25;
 case Encinitas:
      rate = 7.5;
 case LaJolla:
      rate = 7.75;

This will be the center of your code.

The rest will revolve around getting this working and then calculating the final value.

Clearly, you need to declare a variable called 'rate' which is of type 'float'.
Also you will need to discover the area that the trade is taking place from the data provided. In this case you are only asked to calculate the sales tax amount for each area for an item of value 125.00 so this should be easy to add in.

Is this sufficient help to get you going?

It is actually possible to produce the three values required using an exceptionally simple program that doesnt use the above code at all but that would not help you help your son to understand the process. If you would like to produce that code to start with, go through the process on a calculator and carefully write down the steps you took to get the answers. W can then help you implement that simple maths in a C program.


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

I woul welcome your help in assisting Eaddy with his question. The technique used in your C++ code would demonstrate the simple solution I mentioned. If you could explain the details behind the process with examples in C I am sure Eaddy would be grateful.

Pauls is right and you are wrong Tarcis. Full solutions to homework question are not what EE understands under help. Paul is much more forgiving about that as he should, if he deleted the code then for good reasons. BTW this problem is really such a small one, as writen before if you do not have the slightest idea on the basics of C how can you expect to explain it to someone else?

The right answer would have been, Check a decent book about C programming.
The OP has not even shown that he has the slightest idea about what may be involved how can one help someon who does not know or has forgotten what * and / are for?

EaddyAuthor Commented:
thanks for the help  paul. I got an E-book from a friend,  learn C++ in 21 days(lets see how this works out).
i should be able to get a full undersatnding of the basics over the weekend.

again thanks you for your help
Hi Eaddy,

No problem! Ask more questions if you get stuck or just find something unclear.

Was the E-Book free? Is it available on the net? If so where?

EaddyAuthor Commented:
he sent it to me throw msn
not sure where he got it from. will ask him when comes online later
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

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.