I need a script which by dialog box takes first the number of the
marks of a student and then calculate what is the avarege mark. I
write such a script (The one which is above) but instead of treating
the result of the prompt as numerical it treats them like string.
Where is my mistake?
<script>
MarkN = 0;
MarkC = 0;
Total = '';
MarkN = prompt ("What is the count of Your marks?",0);
i = 0;
while (i<MarkN) {
MarkC = prompt ("What is your mark?",0);
Total = MarkC + Total;
i++;
}
MarkC = Total/MarkN;
</script>