Thread: C++ help
View Single Post
Old 10-03-2012, 06:07 PM   PM User | #8
oracleguy
Rockstar Coder


 
Join Date: Jun 2002
Location: USA
Posts: 9,043
Thanks: 1
Thanked 322 Times in 318 Posts
oracleguy is a jewel in the roughoracleguy is a jewel in the roughoracleguy is a jewel in the rough
Ok, so you are only setting the rate and subtotal if the days are greater than 6. You need to do it even if the days are less. Add an else to calculate the subtotal if there is no discount for the number of days.

You can figure this out by stepping line by line through the program and inspecting the variables, inside the number of weeks if block you can see that the subtotal variable is 0 which means it was never assigned to.
__________________
OracleGuy
oracleguy is offline   Reply With Quote