Computer Science Canada

Accumulator Question + Counter

Author:  SucreTeen123 [ Fri Jun 01, 2012 3:19 pm ]
Post subject:  Accumulator Question + Counter

Okay so my goal is to add prices together with 13% tax included in the toal bill and somehow include counter into it. But right now I am stuck on how to add them together properly. When I
try to add numbers together with the tax number it doesn't work properly. Please help!


%Calculating Page

var purchasecost : real
var taxmoney : real
taxmoney := 0
var total : real
total := 0
const tax := 0.13
var answer : string


loop
put "Please enter the cost of the item you wish to purchase"
put "Type in 0 to exit program"
get purchasecost

if purchasecost = 0 then
put "Are you sure (Y/N)"
get answer

exit when answer = "y" or answer = "Y"
end if

taxmoney := purchasecost * tax
total := taxmoney + purchasecost
end loop



put "The total cost for the CDs are ", total, " dollars."

Author:  Tony [ Fri Jun 01, 2012 5:31 pm ]
Post subject:  RE:Accumulator Question + Counter

in what way does it not work properly?

Author:  SucreTeen123 [ Fri Jun 01, 2012 11:17 pm ]
Post subject:  Re: Accumulator Question + Counter

It says that the values are not the same so I can't use it.

Author:  Tony [ Sat Jun 02, 2012 1:51 am ]
Post subject:  RE:Accumulator Question + Counter

So make values the same and use it.

Serious reply: what values? Not the same what, type? Provide line number of the problem and the actual error message.


: