|
-
May 8th, 2009, 02:18 PM
#16
Re: calculating discount percents
Try typing these lines into the beginning of your program and see what happens:
Code:
for (int i = 0; i < 10; i++)
cout << i/4 << endl;
for (int i = 0; i < 10; i++)
cout << i/4.0 << endl;
-
May 8th, 2009, 03:21 PM
#17
Re: calculating discount percents
rottenstock, have you noticed that the layout when you post code differs from when others post code? That's because posts in this forum uses some formatting tags. You can read more about them here http://www.codeguru.com/forum/misc.php?do=bbcode
Last edited by S_M_A; May 8th, 2009 at 03:22 PM.
Reason: Spelling
-
November 19th, 2010, 07:09 PM
#18
Re: calculating discount percents
everytime i do it how i think it should be done, the result is 0.
I'm very new at this, but from the research i have done, it seems like i should use a float command, but i am still confused by that.
Basically, it's going to be:
ItemPrice * ProductDiscountRate (which should be a %, like .25) = Subtoal
and then the Senior Discount is suppose to be Subtotal * SeniorDiscountRate
But both of those ways return a value of 0.
Government ********
-
November 19th, 2010, 08:36 PM
#19
Re: calculating discount percents
 Originally Posted by christinejones
everytime i do it how i think it should be done, the result is 0.
I'm very new at this, but from the research i have done, it seems like i should use a float command, but i am still confused by that.
Basically, it's going to be:
ItemPrice * ProductDiscountRate (which should be a %, like .25) = Subtoal
and then the Senior Discount is suppose to be Subtotal * SeniorDiscountRate
But both of those ways return a value of 0.
********** ********
You're allowed to start your own thread. 
Let's see your code.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|