Nested Conditionals FRQ Practice

Responses receive AI feedback against a rubric after submission. Scores are practice estimates.

Question 1 of 5

Vending cooler. sensorCold false and doorShut true. (a) Trace the displayed message. (b) Values that display ready. (c) Why doorShut is irrelevant when sensorCold is false.

IF (sensorCold)
{
  IF (doorShut)
  {
    DISPLAY ("ready")
  }
  ELSE
  {
    DISPLAY ("shut door")
  }
}
ELSE
{
  DISPLAY ("cool longer")
}

Question 2 of 5

Hall pass system. (a) Display when period is 3 and nursePass true. (b) Display when period is 6 and nursePass true. (c) For period 6, does changing nursePass affect output? Justify.

IF (period <= 5)
{
  IF (nursePass)
  {
    DISPLAY ("office")
  }
  ELSE
  {
    DISPLAY ("class")
  }
}
ELSE
{
  DISPLAY ("dismissed")
}

Question 3 of 5

Structure R: IF (intl) { IF (weight > 5) { DISPLAY ("air") } ELSE { DISPLAY ("ground") } } ELSE { DISPLAY ("domestic") } Structure S: IF (weight > 5) { IF (intl) { DISPLAY ("air") } ELSE { DISPLAY ("heavy domestic") } } ELSE { DISPLAY ("light") } (a) intl true, weight 8: each display? (b) intl false, weight 8: each display? (c) Where do they disagree, and which matches: international over 5 use air; other international use ground; non-international always domestic?

Question 4 of 5

Complete outputs for the fuel logic.

fuel reserve
30 true
5 false
5 true
IF (fuel < 10)
{
  IF (reserve)
  {
    DISPLAY ("use reserve")
  }
  ELSE
  {
    DISPLAY ("refuel")
  }
}
ELSE
{
  DISPLAY ("cruise")
}

(a) Three outputs in order. (b) Which row never evaluates reserve? Why? (c) What must be true for use reserve?

Question 5 of 5

Photo booth. brightness 40 and nightMode false. (a) Trace the display. (b) Values that display glow. (c) Rewrite the inner logic so glow appears whenever brightness < 50 even if nightMode is false.

IF (brightness < 50)
{
  IF (nightMode)
  {
    DISPLAY ("glow")
  }
  ELSE
  {
    DISPLAY ("soft")
  }
}
ELSE
{
  DISPLAY ("bright")
}