CISC181 Introduction to Computer Science Dr. McCoy Lecture 5 Clicker Questions September 15, 2009Slide 2Slide 3Slide 4Slide 5Slide 6Slide 7Slide 8Slide 9Slide 10Slide 11Slide 121CISC181 Introduction to Computer ScienceDr. McCoyLecture 5Clicker QuestionsSeptember 15, 2009How long did you work on lab02?(a) 1-2 hours(b) 3-4 hours(c) 5-6 hours(d) 7-8 hours(e) > 8 hours2If grade has the value of 60 what will the following code print? if ( grade >= 60 )cout << “Passed”;(a) nothing(b) 60(c) Passed(d) cout << “Passed”3What is wrong with the following while loop? While ( sum <= 1000 ) sum = sum + 30;(a) The parentheses should be braces.(b) Braces are required around sum = sum + 30;.(c) While should be while.(d) There should be a semicolon after While ( sum <= 1000 ).4How many times will the following program print hello? i = 1; while ( i <= 10 ) cout << “hello”;(a) 10(b) 8(c) an infinite number of times(d) 05An uninitialized local variable contains(a) the value last stored in the memory location reserved for that variable(b) no value(c) a value of zero(d) a randomly assigned value6KFM – later – not a really good questionIndefinite repetition is controlled by a(a) counter(b) sentinel value(c) absence of a condition(d) non-constant condition7KFM later – really not a good question – very unclear - In indefinite repetition, an input value(a) should always be evaluated before being processed(b) should always be processed directly after it is entered(c) should never be modified(d) can be entered, processed, and evaluated in any order8Which operation does not take place in the following example? int x = 21; double y = 6; double z = 14; y = x / z; x = 5.5 * y;(a) implicit conversion(b) promotion(c) explicit conversion(d) truncation9Having a loop within a loop is known as(a) recursion(b) doubling up(c) nesting(d) a redundancy10If x = 3, which of the following sets x to 7?(a) x *= 4;(b) x += 4;(c) x =+ 4;(d) x + 4 = x;11Which of the following will not increment variable c by one?(a) c + 1;(b) c++;(c) ++c;(d) c +=
View Full Document