Based on the dangling-else discussion, modify the following 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 inden- tation. We’ve eliminated the indentation from the following code to make the problem more chal- lenging. [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:

```
@@@@@
$$$$$
&&&&&
```

Computer Science & Information Technology

You might also like to view...

The _______ are the part of the hard drive that actually transmits or receives the 1s and 0s to or from the hard drive

Fill in the blank(s) with correct word

Computer Science & Information Technology

Graphics method __________draws a filled version of a GraphicsPath.

a) FillShape b) FillGraphic c) Fill d) FillPath

Computer Science & Information Technology