Multiple choice

Directions: Use the following program segment:

IF Sex$ = "M" THEN IF Height > 66 THEN IF Weight > 180 THEN PRINT "Try out for the football team." END IF END IF END IF

Which of the following could replace this statement?

  1. IF (Sex$ = "M") AND (Height > 66) AND (Weight >180) THEN PRINT "Try out for football team." END IF
  2. IF (Sex$ = "M") OR (Height > 66) OR (Weight > 180) THEN PRINT "Try out for football team." END IF
  3. IF (Sex$ = "M") AND (Height > 66) OR (Weight > 180) THEN PRINT "Try out for football team." END IF
  4. IF (Sex$ = "M") AND NOT (Height > 66) AND (Weight > 180) THEN PRINT "Try out for football team." END IF
Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The nested IFs require ALL conditions to be true: Sex$ = "M" AND Height > 66 AND Weight > 180. Only option A correctly uses AND to combine all three conditions.