Assignment Blog 2; Fixing myMean
To begin, we must first see what the problems are, and sometimes they're highlighted by the error message which is as follows:
The error message shows that the code is not working as intended because "assignment" is not found. This helps us easily flag our issues within the code. First "someData" is not a variable that has been established so it cannot be referenced in this program, and sum(assignment) is missing the 2 that it very much needs to be the variable that has values stored. A corrected version of the above code is shown here:
As you can see above, fixing the variable names allowed for the program to properly reference what it needed to, in order to function as intended. The average output is correct, double checked with a calculator just to be sure, with the mean score on assignment 2 being 19.25.
Comments
Post a Comment