Instructional Material: Comparison Quiz

Printer-friendly version

Given the following list of Java variables:

float a = 15.4

float b = 5.6

float c = a - b

Evaluate the boolean value (true or false) of each comparison:

1)         a > b;

2)         c > a;

3)         A == a;

4)         (a > b) || (b < c);

5)         b = 5.1;

6)         b == 5.6;

7)         !(c < a)

8)         (c < a) && (b > a);

9)         !(b != b)

Here are the answers.

Material Type: 
Lab Activity
Education Level: 
HW Platform: 
SW Platform: 
Interactivity Style: 
Copyright (c) 2017 by the author. All rights reserved.