{
  "translations": {
    "en": {
      "sc1": "This animation shows the steps of an algorithm to calculate and print the average of the values in a list. This animation is an example of the accumulate pattern where two values are accumulated within the same iteration. In this problem we take the values in the list to be the price of items being purchased.",
      "sc2": "The state for this algorithm has four variables. The iteration variable is named price. The variable total accumulates the sum of the values in the list. The variable count accumulates the number of values in the list. The variable average is the desired average value that will be printed.",
      "sc3": "The first step is to assign an appropriate initial value for the variable count that will be used to find the number of values in the list.  An appropriate initial value is 0 (zero) because this reflects the number of values before we have encountered any of the list values. Notice that the state correctly shows the result of this assignment.",
      "sc4": "The next step is to assign an appropriate initial value for the variable total that will be used to find the sum of the values in the list.  An appropriate initial value is 0 (zero) because this reflects the sum of the values in the list before we have encountered any of the list values. Notice that the state correctly shows the result of this assignment.",
      "sc5": "On the first step of the iteration the iteration variable price is assigned the value of the first element of the list (4). Notice that this value is shown in the state.",
      "sc6": "The first calculation inside the iteration adds one to the value of the variable count, changing its value from 0 to 1 because we have now seen the first value in the list. Notice that the state has changed to reflect the new value of the variable count.",
      "sc7": "The second calculation inside the iteration computes the sum of the total (0) and price(4). You can rewind one step in the animation to see that the starting value of total was 0. Notice that the new value for total (4) is shown in the state. At this point the value of the variable total represents the result of accumulating just the first value in the list (4).",
      "sc8": "The next step in the iteration begin by assigning the next value in the list (13) as the value of the variable price. Notice that the value of total in the state reflects its new value. This value is the result of accumulating just the first value in the list (4).",
      "sc9": "The first calculation inside the iteration adds one to the value of the variable count, changing its value from 1 to 2 because we have now seen the second value in the list. Notice that the state has changed to reflect the new value of the variable count.",
      "sc10": "The second calculation inside the iteration computes the sum of the total (4) and price (13). You can rewind one step in the animation to see that the starting value of total was 4. Notice that the new value for total (17) is shown in the state. At this point the value of the variable total represents the result of adding the first two values in the list (4 and 13).",
      "sc11": "The next step in the iteration begin by assigning the next value in the list (6) as the value of the variable price. Notice that the value of total in the state reflects its new value. This value is the result of accumulating the first two values in the list (4 and 13).",
      "sc12": "The first calculation inside the iteration adds one to the value of the variable count, changing its value from 2 to 3 because we have now seen the third value in the list. Notice that the state has changed to reflect the new value of the variable count.",
      "sc13": "The second calculation inside the iteration computes the sum of the two variables total (17) and price (6). You can rewind one step in the animation to see that the starting value of total was 17. Notice that the new value for total (23) is shown in the state. At this point the value of the variable total represents the result of adding the first three values in the list (4, 13 and 6).",
      "sc14": "The next step in the iteration begin by assigning the next value in the list (9) as the value of the variable price. Notice that the value of total in the state reflects its new value. This value is the result of accumulating the first three values in the list (4, 13 and 6).",
      "sc15": "The first calculation inside the iteration adds one to the value of the variable count, changing its value from 3 to 4 because we have now seen the fourth value in the list. Notice that the state has changed to reflect the new value of the variable count.",
      "sc16": "The second calculation inside the iteration computes the sum of the total (23) and price (9). You can rewind one step in the animation to see that the starting value of total was 17. Notice that the new value for total (32) is shown in the state. At this point the value of the variable total represents the result of adding the first four values in the list (4, 13, 6 and 9).",
      "sc17": "The next step in the iteration begin by assigning the next value in the list (11) as the value of the variable price. Notice that the value of total in the state reflects its new value. This value is the result of accumulating the first four values in the list (4, 13, 6 and 9).",
      "sc18": "The first calculation inside the iteration adds one to the value of the variable count, changing its value from 4 to 5 because we have now seen the fifth value in the list. Notice that the state has changed to reflect the new value of the variable count.",
      "sc19": "The second calculation inside the iteration computes the sum of total (32) and price (11). You can rewind one step in the animation to see that the starting value of total was 32. Notice that the new value for total (43) is shown in the state. At this point the value of the variable total represents the result of adding the first five  values in the list (4, 13, 6, 9 and 11).",
      "sc20": "There are no more items in the list. The iteration is now complete and the steps following the iteration will be performed. Notice that the value of total in the state reflects its new value. This value is the result of accumulating the first five values in the list (4, 13, 6, 9 and 11).",
      "sc21": "At the completion of the iteration, the calculation of the average is performed (dividing the total, 43, by the price, 5). Notice that these are the current values of the variables in the state.",
      "sc22": "The result of the calculation (8.6) is assigned as the value of the variable average. Note that the state reflects this value of average.",
      "sc23": "The print statement following the iteration is now performed. This statement displays on the console the current value of the variable average (the number 8.6). Notice that this number now appears in the console.",
      "sc24": "Remember that the print statement is needed to display the value to a human using the algorithm because the state values are inside the computer and invisible unless displayed."
    }
  }
}
