Computer Science Canada Programming C, C++, Java, PHP, Ruby, Turing, VB   Username:   Password: Wiki   Blog   Search   Turing   Chat Room  Members
how to ue percents(for a cash register)
Author Message
the_scott_mans

Posted: Mon Mar 31, 2003 2:49 pm   Post subject: how to ue percents(for a cash register)

I was just wondering on how to calculate the pecent of somthing for cash register (TAXES)

EX. \$28.00 + 15%

Tony

Posted: Mon Mar 31, 2003 3:16 pm   Post subject: (No subject)

you multiply by persantage/100.

if you add persantage then first you find what the persantage is (though multiplying) then you add.

 code: total := subtotal + subtotal*15/100

or you can just use 0.15 which is same as 15/100
Tony's programming blog. DWITE - a programming contest.
the_scott_mans

Posted: Mon Mar 31, 2003 3:39 pm   Post subject: (No subject)

thanks i think this is a great site
the_scott_mans

Posted: Mon Mar 31, 2003 3:45 pm   Post subject: (No subject)

do you know how to get it to only add up the choices selected
Asok

Posted: Mon Mar 31, 2003 5:38 pm   Post subject: (No subject)

use a boolean(true/false variable) per specific item to determine what has been selected and what hasn't.
the_scott_mans

Posted: Mon Mar 31, 2003 6:46 pm   Post subject: (No subject)

How would i go about doing this? like would i put "get (var)" and have them enter in the numbers and when the number was entered it would be like a true statement.

Do you know a little of the code just an example so i can see how it is done just wondering i think i know what you mean.

Posted: Mon Mar 31, 2003 7:29 pm   Post subject: (No subject)

 code: var choice:boolean:=false %declare the var as false... make it true later on in your %program, if something happens that makes it true %your code here if choice = false then %do whatever else %do whatever if its true end if
the_scott_mans

Posted: Mon Mar 31, 2003 9:11 pm   Post subject: (No subject)

after i have done all that what would i put for the true statement how would i add up the prices

sorry i am new to this and thanks to all u who hae been helping me