This if statement should assign the heavier weight to heaviest and
the lighter weight to lightest. What is wrong with this code?

```1 if (weight1 > weight2)
2 heaviest = weight1;
3 lightest = weight2;```
A. Nothing. It works fine.
B. Heaviest is weight1 regardless of the if statement.
C. The statement is written incorrectly – crash.
D. Line 3 gets executed no matter what. {} are needed.

D

Computer Science & Information Technology

You might also like to view...

If you want to pass an array element into a method by reference, what will you need to do?

a) It always passes the element as a reference automatically. b) Use the keyword ByRef c) Each of the above. d) None of the above, passing in by reference of an array element is only possible if the array type is a reference type.

Computer Science & Information Technology

You can change ____ to suit your needs, such as adjusting the margin to accommodate a page layout.

A. styles B. mobile elements C. portfolios D. Views

Computer Science & Information Technology