quiz5_001_sol

quiz5_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 5 – Thursday 11/8 SOLUTION 1. In a while loop, the loop body is executed: a. each time the counter is incremented b. only if the condition is true c. the same number of times as the loop condition is evaluated d. once less than the number of times the loop condition is evaluated e. once more than the number of times the loop condition is evaluated f. b) and d) 2. Given the text's graphics package, and given that a Point p , a Circle c , and a double x have already been correctly declared and initialized, which statement has a syntax error? a. x = ( c.get_center() ).get_x(); b. p = cwin.get_mouse("click anywhere"); c. Point new_p = p.move(3, 4); d. Circle new_c = Circle(p, x); e. x = p.get_x() + ( c.get_center() ).get_x(); f. none of the above 3. Which of the following expressions always evaluates to true, no matter what the value of the variable x (read the options carefully!!) ? a.
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

quiz5_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