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

Username:   Password: 
 RegisterRegister   
 What does?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
nin




PostPosted: Thu Dec 14, 2006 5:44 pm   Post subject: What does?

what does programTitle store?
what does the or command do?
how does the command title ("Random Numbers") work?
-------------------------------------------------------------------------------------
Code:

%Random Numbers

%Declaration Sectiom
var number : int

%program Title
procedure title (programTitle : string)
var len : int := length (programTitle)

cls
locate (1, 40 - len div 2)
put programTitle
put " "
end title

procedure displayRand

title ("Random Numbers")
randint (number, 110, 135)
put "A random number from 110 to 135 is: ", number
delay (300)

end displayRand

loop

displayRand
exit when number = 121 or number = 130
end loop
Sponsor
Sponsor
Sponsor
sponsor
Hackmaster




PostPosted: Thu Dec 14, 2006 9:37 pm   Post subject: (No subject)

Well, the guy who programmed this is Either trying to demonstrate a point, ... or is just a moron.

These procedures are custom made. the first one takes a string as input, and just outputs it to the screen. the second one generates a random number, and then it outputs it as well.

There is a good chance that the reason you are asking this is becuase you don't really know what procedures are, and I invite you to look up my tutorial on the subject, titled "A little tutorial about procedures" in the turing help section. then again, it was my first post, so maybe, you might read someone elses.

I hope that helped!
uberwalla




PostPosted: Thu Dec 14, 2006 9:57 pm   Post subject: (No subject)

ok so basically the procedure 'programTitle' is a long way of putting a title onto the screen.

the 'or' statement just says that if something is either blah OR blah then do this or that... if that makes sence. its basic english Razz (sorry if english is your second language)

and title ("Random Numbers") calls upon the procedure.

title calls the procedure and ("Random Numbers") is the variable the procedure wants so it can run.

procedure title *****(programTitle : string) ****
in between the stars is what the procedure calls for to run. which since it is string had to have the quotations.
CodeMonkey2000




PostPosted: Thu Dec 14, 2006 10:55 pm   Post subject: (No subject)

next time please refer to the Turing Walkthrough
http://www.compsci.ca/v2/viewtopic.php?t=8808
NikG




PostPosted: Thu Dec 14, 2006 11:45 pm   Post subject: (No subject)

Is it just me, or does that look like a question from a test/assignment?
Clayton




PostPosted: Fri Dec 15, 2006 9:56 am   Post subject: (No subject)

If it's from an assignment I find that pretty sad
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  [ 6 Posts ]
Jump to:   


Style:  
Search: