Section 6 Using Scanner and Conditional Statements
Section 6 Using Scanner and Conditional Statements
Statements
Test: Using Scanner and Conditional
Statements: Quiz
Review your answers, feedback, and question scores below. An asterisk (*) indicates a
correct answer.
Section 1
(Answer all questions in this section)
1.What will print if the following Java code is executed?
Mark for
Review
(1) Points
0
3 (*)
4
5
Correct
5.The six relational operators in Java are:
Mark for
Review
(1) Points
>,<,=,!,<=,>=
>,<,=,!=,=<,=>
>,<,=,!=,<=,>=
>,<,==,!=,<=,>= (*)
Incorrect. Refer to Section 5 Lesson 1.
6.Determine whether this boolean expression evaluates to true or false:
Mark for
!(3<4&&5>6||6<=6&&7-1==6)
Review
(1) Points
True
False (*)
Correct
1The following code fragment properly implements the switch statement.
Mark for
0.True or false?
Review
(1) Points
default(input)
switch '+':
answer+=num;
break;
case '-':
answer-=num;
break;
!default
System.out.println("Invalid input");
True
False (*)
Correct
Page 1 of 1