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

Username:   Password: 
 RegisterRegister   
 I've Been Working On Calculating Coins!
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
master-awesome




PostPosted: Mon Nov 17, 2014 1:04 pm   Post subject: I've Been Working On Calculating Coins!

Quote:
var amt : int
var quarters :int
var dimes : int
var nickels : int
var pennies : int
var remain : int
put "Enter the change in cents: "..
get amt

quarters := amt div 25
remain := amt mod 25

put "Quarters: "
..put quarters

dimes := remain div 10
put "Dimes: "
..put dimes

remain := amt-(quarters*25)-(dimes*10)
nickels := remain div 5

put "Nickels: "
..put nickels

remain := amt-(quarters*25)-(dimes*10)-(nickels*5)
pennies := remain div 1

put "Pennies: "
..put pennies


What do you think?
Sponsor
Sponsor
Sponsor
sponsor
Insectoid




PostPosted: Mon Nov 17, 2014 1:16 pm   Post subject: RE:I\'ve Been Working On Calculating Coins!

What sort of thoughts are you looking for?

Also, pennies don't exist anymore.
master-awesome




PostPosted: Mon Nov 17, 2014 1:38 pm   Post subject: Re: I've Been Working On Calculating Coins!

Did I type this program correctly?
Insectoid




PostPosted: Mon Nov 17, 2014 1:45 pm   Post subject: RE:I\'ve Been Working On Calculating Coins!

Does it work?
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  [ 4 Posts ]
Jump to:   


Style:  
Search: