CS 38-Summer09_Quiz_2 Solution

CS 38-Summer09_Quiz_2 Solution - Steve Houseman Page 1...

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

View Full Document Right Arrow Icon
Steve Houseman Page 1 10/5/2011 CS38-Java- Quiz # 2-Summer 2008 Solution Time allowed 30 minutes, Total = 5 points. Instruction: Please complete all 10 multiple choice questions, by marking the correct answer on Scranton (Form No. 882-E). Please use a No. 2 pencil only. Ink will not be recognized by the Scranton reader. After completing your quiz, please hand in only your completed scantron. You may keep this Quiz sheet for your reference! This Quiz consists of three (4) pages. 1. When evaluating a compound Boolean expression joined by an AND (&&) logical operator, in a selection statement, then a. Both expressions must evaluate to true for the compound Boolean expression to evaluate to true. b. Only the first expression must evaluate to true for the compound Boolean expression to evaluate to true. c. The first expression must evaluate to false and the second expression must evaluate to true for the compound Boolean expression to evaluate to true. d. Not enough information is given for the Boolean expression to evaluate to true. 2. The controlling expression for a switch statement includes all of the following types except: a. double b. char c. int and byte d. short . 3. What is the output of the following Java code? int x = 55; int y = 5; switch (x % 7) { case 0: case 1: y++; case 2: case 3: y = y + 2; case 4: break; case 5: case 6: y = y – 3; a. 8 b. 5 c . 2 d. None of the above
Background image of page 1

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

View Full DocumentRight Arrow Icon
Steve Houseman Page 2 10/5/2011 4. You coded the following in class
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/05/2011 for the course CS 38 taught by Professor Stevehouseman during the Summer '09 term at Irvine Valley College.

Page1 / 4

CS 38-Summer09_Quiz_2 Solution - Steve Houseman Page 1...

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

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