Suppose income is 4001, what is the output of the following code?

if (income > 3000) {
System.out.println("Income is greater than 3000");
}
else if (income > 4000) {
System.out.println("Income is greater than 4000");
}

a. no output
b. Income is greater than 3000
c. Income is greater than 3000 followed by Income is greater than 4000
d. Income is greater than 4000
e. Income is greater than 4000 followed by Income is greater than 3000


b Since income is 4001, the condition (income > 3000) is true. So statement for the true case is executed.

Computer Science & Information Technology

You might also like to view...

Given network IP address 172.16.0.0 and subnet mask 255.255.192.0, how many subnets are in this network?

a. 2 b. 4 c. 8 d. 16

Computer Science & Information Technology

Figure8.2 illustrates how ?les areshared between a parent process and its child process. Write a program to validate that all open ?le descriptors in the parent and child point to the same ?les, and that the ?le status ?ags and offsets areshared

What will be an ideal response?

Computer Science & Information Technology

Krug says that if you have room in your head for only one usability principle, it should be ___________________.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

A(n) ____________________ is a central database that translates names to IP addresses (or IP addresses to names).

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology