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...

Which of the following types of software made it cheaper and easier to start Web 2.0 companies?

a. Vaporware. b. Proprietary. c. Open source. d. None of the above.

Computer Science & Information Technology

The .exe file extension indicates that the file is _________.

a) extensible b) executable c) existent d) extinct

Computer Science & Information Technology