Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 how to ue percents(for a cash register)
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
the_scott_mans




PostPosted: 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%
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: 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.

so canadian tax is:
code:

total := subtotal + subtotal*15/100


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




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

thanks i think this is a great site
the_scott_mans




PostPosted: 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




PostPosted: 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




PostPosted: 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.
Blade




PostPosted: 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




PostPosted: 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
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 8 Posts ]
Jump to:   


Style:  
Search: