Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Help with a C program!

Name: Anonymous 2011-11-28 18:02

Okay guys, here is the problem I'm trying to solve:

Suppose there is a company that sells an item at a base retail price of $57.95. They give discounts if for volume purchases. Suppose they give the following discounts:
Quantity Discount
1-4 no discount
5-9 10%
10-19 20%
20-49 30%
50-more 35%
Write a program that asks the user to enter how many of the items they wish to buy. The program should then display messages saying what there total discount was (if any) and the total cost for the purchase after the discount. As the total will be in dollars and cents, when giving the output the prices should be formatted to print with two digits past the decimal place.



And here is my code:
http://pastebin.com/Ct0JSXQT


Can anyone please tell me what I'm doing wrong?
(I am pretty new to C programming, so please forgive my stupidity.)

Name: Anonymous 2011-11-28 18:45

Okay, scratch the other pastebins, I got this one:

http://pastebin.com/kn9kxxVi

Which is not leading to any compiling problems.

Also, it recognizes the appropriate discount percentages now, it just seems that the only problem is that it is not actually printing a final discounted price.

See here (a screenshot of the output):
http://i.imgur.com/fy9cY.jpg

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List