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

Username:   Password: 
 RegisterRegister   
 I need help with my exam questions
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
lei4848




PostPosted: Wed Jun 07, 2006 9:31 pm   Post subject: I need help with my exam questions

Please post the answer to the following questions


1. The way to read the integer value 5 from the keyboard into variable X is to

a) use an assignment statement: X := 5
b) initialize the variable in its declaration: var X :int := 5
c) use a get statement: get X
d) use this assignment statement: X = 5
e) use this get statement: get X , 5


2. Here is a line in a program:

P := 99 % .99

a) % means divide 99 by .99 and truncate the fraction
b) the statement finds what percent 99 is of .99
c) % means to find what percent .99 is of 99
d) % is the beginning of a comment so the computer ignores .99
e) there is a syntax error: % is not an arithmetic operator


3. There is a string variable called ADDRESS. Suppose you want this variable to contain the string value:

846 W. Elm Street

Which one of these is true?

a) You can use the get statement: get ADDRESS and at run time type:
846 W. Elm Street
b) You can use the get statement: get ADDRESS:* and at run time type:
846 W. Elm Street
c) You can use this assignment statement:
ADDRESS := 846 W. Elm Street
d) You can use this assignment statement:
"ADDRESS" := "846 W. Elm Street"
e) You cannot store "846 W. Elm street" because it contains blanks.


4. Paragraphing a program (indenting parts of it)

a) is required to avoid syntax errors
b) is a way to help make programs easier to understand
c) makes program run faster
d) makes programs run slower
e) must be done under computer control

5. To set a real variable X randomly to a value between 0 and 1, use

a) rand (X)
b) rand ( X,0.0,1.0)
c) randint(X,0..1)
d) randint(0, 1,X)
e) randint ( X,0,1)
Sponsor
Sponsor
Sponsor
sponsor
TheOneTrueGod




PostPosted: Wed Jun 07, 2006 9:40 pm   Post subject: (No subject)

This falls under the category of "Doing your homework for you". In the time that it took you to type out that post, wouldn't it have been easier just to use your knowledge and answer the questions on your own? At any rate, if you don't know the answers to some of those questions, then you need to study for the exam anyways, which defeats the purpose of getting other people to answer these review questions...

(I assume that by "exam questions" you mean "exam review questions"...)
Dodad bouldershoulder




PostPosted: Thu Jun 08, 2006 12:39 pm   Post subject: (No subject)

Those exam review questions are there for a reason. Mabye, you know, to learn the answers so you pass the exam. So, how about you review for them!!! Rolling Eyes
Dan




PostPosted: Thu Jun 08, 2006 1:35 pm   Post subject: (No subject)

1. d
2. e
3. e
4. e
5. a
Obvesly thess are not the right awasers. In fact i am prity shure that all of them are worng but whont it be funny if he is writing an exam right now and uses them? What scares me is that i do not think he is refuring to a review but this realy is his exam...
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
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: