9/11/2011

BCS2233 OOP Exercise Chapter 3 (Selection)

3.1 List six comparison operators.


3.2 Assume that x is 1, show the result of the following Boolean expressions:

(true) && (3 > 4) (answer: FALSE)
!(x > 0) && (x > 0)
(x > 0) || (x < 0)
(x != 0) || (x == 0)
(x >= 0) || (x < 0)
(x != 1) == !(x == 1)



3.10 Suppose x = 3 and y = 2, show the output, if any, of the following code.
What is the output if x = 3 and y = 4?
What is the output if x = 2 and y = 2?
Draw a flowchart of the following code:

if (x > 2) {
if (y > 2) {
int z = x + y;
System.out.println("z is " + z);
}
}
else
System.out.println("x is " + x);


Due Date: 12 sept 2011 before 4:00 pm (by email (nazri.ibrahim@gmail.com) or hard copy)

No comments:

Cara download Installer windows 10 dalam format ISO

1. Jika anda bercadang untuk download windows 10 melalui website rasmi windows - pilihan untuk download dalam format ISO tidak di berikan.  ...