next up previous
Next: About this document ...

CS 202 Entrance Quiz Answers


Answer the following questions:
1.
An array can be passed as a parameter only by \fbox{reference}
2.
Parameter passing by \fbox{value/copy} sends the invoked function a copy of the actual parameter's value.
3.
How many times is ``hello'' printed by the following code segment:
        int index = 0;
        while (index < 10) 
        {
              index ++;
              cout << ``hello'' << end;
        }
\fbox{hello is printed 10 times}
4.
What is the appropriate function prototype for a function that receives a character letter grade as an argument and returns its integer equivalent.
(a)
void IntEquiv(char);
(b)
void IntEquiv(int);
(c)
\fbox{int IntEquiv(char);}
(d)
int IntEquiv(int);
(e)
char IntEquiv(int);
5.
An array can contain items of any type (True/False). \fbox{True}
6.
The program finds the largest integer in the array. For the supplied input this is \fbox{9}.


 

Sushil Louis
1998-10-11