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

Username:   Password: 
 RegisterRegister   
 procedures, functions and arrays - how to
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Jimbo1991




PostPosted: Tue Apr 08, 2008 12:52 pm   Post subject: procedures, functions and arrays - how to

i have a test tomarrow, on procedures, functions and arrays and, also on things like how to call a function, how to spot the errors in a code, and i havnt the slightest idea on how to make or do any of these! can anyone explain to me, and show me examples of each of these? thanks
Sponsor
Sponsor
Sponsor
sponsor
DaveAngus




PostPosted: Tue Apr 08, 2008 12:56 pm   Post subject: RE:procedures, functions and arrays - how to

Ask Mr Wilson! haha
Nick




PostPosted: Tue Apr 08, 2008 2:11 pm   Post subject: RE:procedures, functions and arrays - how to

procedure:
code:
procedure foo
    put "foo"
end foo

foo

%or

procedure foo (bar:string)
    put bar
end foo

foo("Hello")

function:
code:
function foo:int
    result 5
end foo

put foo

%or

function foo (bar:string):string
    result bar
end foo

put foo("Hello")


arrays:
code:
var bar:array 1..5 of int
for i:1..5
    bar(i) := i
end for
for i:1..5
    put bar(i)
end for
Tony




PostPosted: Tue Apr 08, 2008 4:15 pm   Post subject: RE:procedures, functions and arrays - how to

we have tutorials to all of those, linked to from The Turing Walkthrough -- those would be an excellent read before a test.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
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: