Consider the class below:

```
public class Test
{
public static void main(String[] args)
{
int[] a = {99, 22, 11, 3, 11, 55, 44, 88, 2, -3};

int result = 0;

for (int i = 0; i < a.length; i++)
{
if (a[i] > 30)
result += a[i];
}

System.out.printf("Result is: %d%n", result);
}
}
```

The output of this Java program will be:
a. Result is: 280.
b. Result is: 286.
c. Result is: 154.
d. Result is: 332.


b. Result is: 286.

Computer Science & Information Technology

You might also like to view...

What is the time complexity of the following program?

int N = 0, M = 10; for (int x = 0; x <= M; x++ ) { writeToDisk(""something""); for (int y = 0; y <= N; y++ ) { Math.random(); } } a. O(M*N) b. O(N) c. O(N^2) d. O(M+N)

Computer Science & Information Technology

A(n) ________ cable carries all audio and video information from devices to a connected TV

A) HDMI B) RJ11 C) S component D) Ethernet

Computer Science & Information Technology

A monitor's resolution refers to:

A) The ratio of width to height of the monitor. B) The number of pixels displayed at one time. C) The difference between the brightest and the darkest a monitor can display. D) Whether LCD, LED, or OLED technology is being used.

Computer Science & Information Technology

The

heading element is the largest of the heading tags

Indicate whether the statement is true or false

Computer Science & Information Technology