Services
Discover
Ask a Question
Log in
Sign up
Filters
Done
Question type:
Essay
Multiple Choice
Short Answer
True False
Matching
Topic
Computing
Study Set
Java Programming From Problem Analysis to Program Design
Exam 4: Control Structures I: Selection
Path 4
Access For Free
Share
All types
Filters
Study Flashcards
Practice Exam
Learn
Question 41
Multiple Choice
switch (lastInitial) { Case 'A': System.out.println("section 1") ; Break; Case 'B': System.out.println("section 2") ; Break; Case 'C': System.out.println("section 3") ; Break; Case 'D': System.out.println("section 4") ; Break; Default: System.out.println("section 5") ; }Based on the code above, what is the output if lastInitial = 'C'?
Question 42
Multiple Choice
After the execution of the following code, what will be the value of num if the input values are 0 3? (Assume that console is a Scanner object initialized to the standard input device.) int num = console.nextInt() ;if (num > 0) Num = num + 13; Else If (num >= 3) Num = num + 15;
Question 43
True/False
Suppose that you have the following code.int num = 10;if (num > 10) System.out.println(num); else System.out.println(num + 5);The output of this code is 5.
Question 44
True/False
The output of the Java code:int alpha = 5; int beta = 4;switch (beta) { case 2: alpha = alpha + 2; case 4: alpha = alpha + 4; break; case 6: alpha = alpha + 6; default: alpha = alpha + 10; } System.out.print(alpha);is: 9