Question
Which of the following expressions will evaluate to false? (3 points) I. 8 != 8.0 II. 8 == 8.0 III. 8 > 8.0 Question 1
Which of the following expressions will evaluate to false? (3 points)
I. 8 != 8.0 II. 8 == 8.0 III. 8 > 8.0
Question 1 options:
|
| ||
|
| ||
|
| ||
|
| ||
|
|
Question 2 (3 points)
Which of the following expressions will evaluate to true? (3 points)
I. 6 / 8 == 0.0 II. 6 / 8.0 == 0.0 III. (int)(6.0 / 8.0) == 0.0
Question 2 options:
|
| ||
|
| ||
|
| ||
|
| ||
|
|
Question 3 (3 points)
Assume an integer variable named num is assigned a value of 15. What is the value of num + 6 < 20? (3 points)
Question 3 options:
|
| ||
|
| ||
|
| ||
|
| ||
|
|
Question 4 (3 points)
What is the result of the following code segment? (3 points)
int n = 5; if(n - 1 < 10) n += 6; System.out.println(n);
Question 4 options:
|
| ||
|
| ||
|
| ||
|
| ||
|
|
Question 5 (3 points)
Assume the integer variable num has been assigned a valid value. What is the purpose of the following code segment? (3 points)
if(num % 5 == 0) System.out.print(num);
Question 5 options:
|
| ||
|
| ||
|
| ||
|
| ||
|
|
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started