Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

finalGrade % 5 && <38

 let finalGrade = [];
    
    for (let i = 0; i < grades.length; i++) {
    

        if (grades[i] <38 || grades[i] % 5 <=2 )  {
            finalGrade[i] = grades[i];
        }
        else {
            for(let j=0; j<2;j++) {
                grades[i] += 1
                if (grades[i] % 5 === 0 ){
                    finalGrade[i] = grades[i];
                    break
                }
            }

        }
    }
   
return finalGrade;
 
PREVIOUS NEXT
Tagged: #finalGrade
ADD COMMENT
Topic
Name
7+3 =