quiz8_sol - CS 010 Intro to Computer Science I Spring -...

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 Spring - 2008 Quiz 8 – Friday 5/30 SOLUTION 1. What is the value of inner_count after the following code executes? for (int i = 0; i < n; i++){ outer_count++; for (int j = 0; j < m; j++){ inner_count++; } } a. 0 b. n c. m d. n + m e. n * m f. n + m + 1 2. Which of the following statements has a syntax error, given n1 is an integer variable, d1 is a double variable, and s1 is a string variable? a. n1 = func1(10, 20.0, “abc”); b. cout << func1(func2(n1),d1,s1); c. if (func3(n1)) cout << s1; d. func2(n1); e. func2(func1(n1, d1, s1)); f. b) and e) 3. Which is the BEST choice for the declaration of a function which raises the salary of an Employee object by raise %? a. Employee raise_sal(double); b. void raise_sal(Employee&, double); c. void raise_sal(const Employee&, double); d. Employee raise_sal(Employee&, double); e. void raise_sal(Employee&, double&);
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 note was uploaded on 06/05/2008 for the course CS 010 taught by Professor Linard during the Spring '08 term at UC Riverside.

Page1 / 2

quiz8_sol - CS 010 Intro to Computer Science I Spring -...

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