quiz6_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 6 – Friday 5/16 SOLUTION 1. Which of the following statements will extract the last letter of the string variable name as a char value? a. char last = name.substr( name.length() ); b. char last = name.substr( name.length() - 1 ); c. char last = name[ name.length() ]; d. char last = name[ name.length() - 1 ]; e. string last = name.substr( name.length() ); f. string last = name.substr( name.length() - 1 ); 2. Which of the following statements is/are syntactically correct (using the text-supplied Time class)? Given: both dinner and eleven_pm are valid, initialized Time objects. a. Time breakfast = now(); b. Time lunch = (12, 15, 0); c. dinner = Time(17, 30, 0); d. Time late_snack = eleven_pm; e. Time now(); f. c) and d) are correct 3. What is the difference between a parameter and an argument, in the context of functions? a. No difference - they are alternative terms for the values passed into a function b.
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.

Page1 / 2

quiz6_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