Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

1)

I only

2)

II only

3)

III only

4)

I and III only

5)

II and III only

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:

1)

I only

2)

II only

3)

III only

4)

I and III only

5)

II and III only

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:

1)

True

2)

False

3)

0

4)

1

5)

An error occurs

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:

1)

1

2)

5

3)

6

4)

10

5)

11

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:

1)

It prints num if its value is a multiple of 5.

2)

It prints num if its value is not a multiple of 5.

3)

It always prints the value of num.

4)

It never prints the value of num.

5)

An error occurs at compile time.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems Third International Conference Achids 2011 Daegu Korea April 2011 Proceedings Part 2 Lnai 6592

Authors: Ngoc Thanh Nguyen ,Chong-Gun Kim ,Adam Janiak

2011th Edition

3642200419, 978-3642200410

More Books

Students also viewed these Databases questions

Question

=+Will the use of fear appeal make the source more persuasive?

Answered: 1 week ago