好吧,我的朋友給了我這個輸入10個等級,並在提示輸出平均值。我對編碼很陌生,不知道該怎麼做。請幫忙!查找數字的平均值
var i, number, average=0;
for (i = 1; i<=10; i++) {
grade = prompt("enter code hereEnter quiz grade: ");
grade = parseInt(grade);
average = average + grade;
document.write("number entered: " +grade+ "<br>");
}
document.write("after loop sum is: " +average+ "<br>");
http://www.mathsisfun.com/mean.html – vtortola