As in C, C++ and Java, a variable must get a value before it is read. This exercise has the mistake: s is never set to 0.

Algorithm Average

Student
  1. Click Run: before the run a warning names s, and the run stops with an error at the block that reads it.
  2. Click Edit, add the Assign s = 0 before the loop and run the tests.
Teacher
  1. In the editor the box Strict: a variable must get a value before it is used turns it on for one algorithm; the site setting gives the default.
  2. In a quiz question the option Strict initialization applies to the runs and the grading.
  3. The generated C, C++, Java and C# code then declares the variables without a start value.