You are viewing a single comment's thread. Return to all comments →
in typescript
const finalGrade: number[] = [] for(let i = 0; i < grades.length; i++) { const newNote = Math.ceil(grades[i] / 5) * 5 const isNewNote = newNote - grades[i] < 3 ? true : false if(grades[i] < 38 || !isNewNote) { finalGrade.push(grades[i]) } else if(isNewNote) { finalGrade.push(newNote) } } return finalGrade
Seems like cookies are disabled on this browser, please enable them to open this website
Grading Students
You are viewing a single comment's thread. Return to all comments →
in typescript
const finalGrade: number[] = [] for(let i = 0; i < grades.length; i++) { const newNote = Math.ceil(grades[i] / 5) * 5 const isNewNote = newNote - grades[i] < 3 ? true : false if(grades[i] < 38 || !isNewNote) { finalGrade.push(grades[i]) } else if(isNewNote) { finalGrade.push(newNote) } } return finalGrade