Hi can someone help me answer these questions. They will help me prepare for my final:
Which of the following is 4 bytes and holds negative and positive whole numbers?
a.float
b.int
c.bool
d.long
A procedural set of instructions that may take arguments and may or may not return a result:
a.property
b.class
c.object
d.function
Special words that are part of the c++ language:
a.subroutines
b.primitives
c.STL
d. reserved or keywords
By default, variables are passed into methods as:
a.copies
b.references
c.pointers
d.all of the above
I/0 that is directed to the console or read in from the keyboard are referred to as:
a.information
b.terminal data
c.data prompts
d.Standard output/input
say your answers, we'll tell you which are wrong.
if you don't know, google it or something. surely you must have some sort of notes..
only if you try can you learn something.
Q1 has no right answer; it depends on the platform. Q4 has no right answer either, since there is no "by default"... it is what the user specifies in the function prototype.
Q1. Indeed. If it had 'at least', it would make more sense..
Q4. By default would mean no 'weird symbols', I suppose. On the other hand, into f(int) a copy of int is passed, into f(int*) - a copy of int*. It's still a copy. Not considering pointer (or reference) an object is a little bit silly.
These are VERY beginner questions so I suspect the simplest, most obvious answer will be the correct one. Sometimes teachers leave out the advanced concepts in test questions so as not to confuse their uninitiated students. Of course that makes them a little ambiguous for you experienced coders.