Based on the dangling-else discussion, modify the code to produce the output shown. Use proper indentation techniques. You must not make any additional changes other than inserting braces and changing the code’s indentation. We’ve eliminated the indentation from the following code to make the problem more challenging. [Note: It’s possible that no modification is necessary.]

```
if (y == 8)
if (x == 5)
System.out.println("@@@@@");
else
System.out.println("#####");
System.out.println("$$$$$");
System.out.println("&&&&&"
```

Assuming that x = 5 and y = 8, the following output is produced:
@@@@@
&&&&&


```
if (y == 8)
if (x == 5) System.out.println("@@@@@");
else { System.out.println("#####");
System.out.println("$$$$$");
} System.out.println("&&&&&");
```

Computer Science & Information Technology

You might also like to view...

____________ was created in the early days of computing as an alternative to machine language.

a. FORTRAN b. COBOL c. assembly language d. Pascal

Computer Science & Information Technology

An application must use a ____ property to either assign data to or retrieve data from a Private variable in a class.

A. Private B. Public C. Default D. Event

Computer Science & Information Technology

A ________ is a website that displays news, content, and links that would be of interest to a particular audience

A) blog B) portal C) favorite D) domain

Computer Science & Information Technology

Each pie slice displayed on a pie chart is an example of a

A) legend. B) chart sheet. C) data marker. D) data point.

Computer Science & Information Technology