So, I've got my code to take in a number of student names and their respective marks. So far so good. But, when it gets to the end, it should put together the marks and find an average, then alert the average to the user. But, as it stands, I get no alert. Here's the code:

PHP Code:
var sQuantity parseInt(prompt("Let's begin compiling our student database. How many students would you like to enter?""Number of Students"));

var 
sList = new Array();
var 
sMarks = new Array();

for (var 
count 0count sQuantitycount++) {
    
sList.push(prompt("Please enter the Student's Name""Students Name"));
}

var 
0;

for (var 
count 0count sQuantitycount++) {
    
sMarks.push(parseInt(prompt("Please enter " sList[i] + "'s average grade for this course.""Enter Average Grade")));
    var 
i=(i+1);
}


var 
sum 0;
var 
cAverage 0;

for (
0sMarks.lengthi++) {
    
sum = (sum sMarks[i]);
}

cAverage = (Sum/sMarks.length);

alert(cAverage); 
Thanks for any help!