Chapt 4cp - 11 Import java.util public class Errors Static Scanner console = new Scanner(system.in Public static void main(string args Int a b c

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

View Full Document Right Arrow Icon
Jeremy Debruce October 24, 2007 HW. Chap 4 Ex. 1. A) True B) False C) False D) False E) False F) False G) False H) False I) True 2. A) i. Hello There B) i. #*# C) ii. Three D) i. 2 4 6 8        1 3 5 7 E) iii. $ 3. 100, 200,0
Background image of page 1

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

View Full DocumentRight Arrow Icon
4. If (code =‘D’) System.out.println(“Democrat”); else if (code = ‘R’) System.out.println(“Republican”); else   System.out.println(“I”); 5. If (score > = 60) System.out.println(“ YOU PASS.”); else  System.out.println(“ YOU FAIL.”); 6. Because (8>4) is true (j++ == 7) is false and true II false is true 7. A) invalid the expression n>=2 is a Boolean value, this is not integral type. The  switch expression must evaluate to an integral value B) invalid case value must not appear more than once C) valid D) valid                       8.     15                       9.      7                      10.     96                      
Background image of page 2
Background image of page 3

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

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

Unformatted text preview: 11. Import java.util.*; public class Errors { Static Scanner console = new Scanner (system.in); Public static void main(string args) { Int a, b, c; Boolean found; System.out.println(“ Enter the first integer:”); a = console.nextInt(); System.out.println(); System.out.println(“ Enter the second integer:”); b = console.nextInt(); if (a > a * b && 10 < b) found = 2 * a > b; else { found = 2 * a > b; if found a= 3; c= 15; if (b >0) { b = 0; a = 1; } } } }...
View Full Document

This note was uploaded on 06/17/2011 for the course COMPUTER S 2301 taught by Professor Staff during the Spring '11 term at Kennesaw.

Page1 / 4

Chapt 4cp - 11 Import java.util public class Errors Static Scanner console = new Scanner(system.in Public static void main(string args Int a b c

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

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