function printAvg(arr) { var avg; var s = 0; for (var i=0; i<arr.length; i++) { s = s + arr[i]; } avg = s / arr.length; write("Your average is " + avg + "\n"); if (avg >= 10 && avg <= 20) { write("Congratulations you have succeeded.\n") } else if (avg >= 0 && avg < 10) { write("Sorry you failed.\n") } else { write("Something wrong, impossible result!\n"); } } methods = ["Algorithms", "Java", "Databases", "Linux", "Networks"]; notes = array(methods.length); for (var i=0; i<methods.length; i++) { do { write(methods[i] + ": "); notes[i] = read(); } while (notes[i] < 0 || notes[i] > 20 || isNaN(notes[i])); } write("---------------\n"); printAvg(notes);
(
)
{
}
[
]
"
;
=
+
-
*
!
/
%
&
|