viewing paste gradeCalc - Average | Javascript

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12
var gradeCalc = function (quiz_1, quiz_2, quiz_3) {
 
    var sum = quiz_1 + quiz_2 + quiz_3;
    var average = sum / 3;
    var msg = "";
 
    if (average <= 45) msg = "FAIL";
    else if (average < 70) msg = "AVERAGE";
    else msg = "GOOD";
 
    return msg;
};
Viewed 1683 times, submitted by Streusel.