Interpreter #ST5 mistake in sample test 4

Just going through the new control flow extension for the interpreter course and noticed a small mistake in sample test case #4 for #ST5 (else statements):

Test Case 4:

Input:

var celsius = 67;
var fahrenheit = 0;
var isHot = false;

{
  fahrenheit = celsius * 9 / 5 + 32;
  print celsius; print fahrenheit;

  if (celsius > 30) {
    isHot = true;
    print "It's a hot day. Stay hydrated!";
  } else {
    print "It's cold today. Wear a jacket!";
  }

  if (isHot) { print "Remember to use sunscreen!"; }
}

Expected Output:

67
152.6
It's a hot day. Stay hydrated!

Expected output should be:

67
152.6
It's a hot day. Stay hydrated!
Remember to use sunscreen!

Had me questioning myself for a moment!

@ndunnett Thanks for highlighting the issue! We’re fixing it in this PR.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.