(26) - RESET CLICKERS TO FREQUENCY A B What is the output...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: RESET CLICKERS TO FREQUENCY A B What is the output of the following code: int x = 2; if (!(x > 0)) { System.out.println(”True."); } System.out.println("X is " + x + "."); A. True. X is 2. A. True. A. X is 2. A. 2 is 2. A. True. 2 is 2. RESET CLICKERS TO FREQUENCY A B What is the output of the following code: int x = 2; if (!(x > 0)) { System.out.println(”True."); } System.out.println("X is " + x + "."); A. True. X is 2. A. True. A. X is 2. A. 2 is 2. A. True. 2 is 2. CSI 201 Introduction to Computer Science Lecture 26 CSI 201 Study Group RESET CLICKERS TO FREQUENCY A B Administrivia RESET CLICKERS TO FREQUENCY A B Administrivia – Program • Programming Assignment Five is available from the class web page. – It is due Monday, Novenber 17 th before midnight. • That means you'll have your final programming assignment due on December 8 th – I'll post it in the next day or two so you can see what you're up against Today’s Content… Conditionals This material corresponds to chapter six in the text. Conditionals RESET CLICKERS TO FREQUENCY A B Using Multiple If Statements • If we are doing two different things based on a set of ranges: 0 <= x < 6 6 <= x if (0 <= x && x < 6) { Statement or block } if (6 <= x) { Statement or block } RESET CLICKERS TO FREQUENCY A B Using Multiple If Statements • If we are doing two different things based on a set of ranges: 0 <= x < 6 6 <= x • But there's a slightly quicker way… the else ststement if (0 <= x && x < 6) { Statement or block } else { Statement or block } RESET CLICKERS TO FREQUENCY A B Using Multiple If Statements • If we are doing two different things based on a set of ranges 0 <= x < 6 6 <= x if (0 <= x && x < 6) Statement or block if (6 <= x) else Statement or block if (0 <= x && x < 6) System.out.println("Fail"); else System.out.println("Pass"); RESET CLICKERS TO FREQUENCY A B What is the output of the following code: int x = 5; if ((x > 0)) { System.out.println("X is positive."); } else { System.out.println("X is 0 or less."); } System.out.println("X is " + x + "."); A. X is positive....
View Full Document

This note was uploaded on 01/17/2009 for the course CSI 201 taught by Professor Doanne during the Fall '08 term at SUNY Albany.

Page1 / 36

(26) - RESET CLICKERS TO FREQUENCY A B What is the output...

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

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