quiz9_001_sol

quiz9_001_sol - CS 010 Intro to Computer Science I Fall -...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 010 – Intro to Computer Science I Fall - 2007 Quiz 9 – Thursday 11/6 - Section 001 SOLUTION 1. If you were to write a function (not a member function) for displaying the contents of an object of the Employee class, which function declaration would be most appropriate? a. Employee display(); b. void display( Employee ); c. void display( Employee& ); d. void display( const Employee& ); e. int display( const Employee& ); f. b), c) and d) are equally appropriate 2. How many elements does the vector v have after the following declaration? vector<int> v(n); a. 0 b. 1 c. n d. n - 1 e. n + 1 f. none of the above 3. What is the index of the last element of the vector grades , declared as follows: vector<int> grades; and then populated by user input a. Unknown - you would have to track the vector as it is being populated b. The maximum index value allowed by the particular compiler you are using c. grades.size() d. grades.size() - 1 e. grades.size() + 1 f. grades.push_back() 4. Which of the following function headers is the
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This test prep was uploaded on 04/15/2008 for the course CS 10 taught by Professor Linard during the Fall '07 term at UC Riverside.

Page1 / 2

quiz9_001_sol - CS 010 Intro to Computer Science I Fall -...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online