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

Username:   Password: 
 RegisterRegister   
 Hello I am having a little problem with my code ! I would love a fast response!
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
themunit




PostPosted: Wed Oct 08, 2014 3:45 pm   Post subject: Hello I am having a little problem with my code ! I would love a fast response!

What is the problem you are having?



Describe what you have tried to solve this problem
< I have tried replacing the value or even the whole varable. I am trying to make a change machine. when I try to run my code to see if the first one is right for toonies and how much it will give back, the program says assigned value is the wrong type>





Turing:


<%adding variables
var cash : real
var toonies : int
var loonies : int
var quarters : real
var dimes : real
var nickles : real
var pennies : real
var rtoonies : int
var ntoonies : real
%addiing values to variables
toonies := 2
loonies := 1
quarters := 0.25
dimes := 0.10
nickles := 0.05
pennies := 0.01

% starting the program interface
put " *~* Welcome to the make change machine *~* "
put " Please enter the amount of money you have: "
get cash

% doing the math
ntoonies := cash div toonies
rtoonies := cash mod toonies
>



Please specify what version of Turing you are using
<latest verison>
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Wed Oct 08, 2014 4:27 pm   Post subject: RE:Hello I am having a little problem with my code ! I would love a fast response!

What is the type of the variable? What is the type of the value you are trying to assign to that variable?
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
themunit




PostPosted: Wed Oct 08, 2014 4:45 pm   Post subject: RE:Hello I am having a little problem with my code ! I would love a fast response!

I fixed it thanks for the comment tho. it was just the wrong :int after the var
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  [ 3 Posts ]
Jump to:   


Style:  
Search: