Sort by

recency

|

4080 Discussions

|

  • + 0 comments

    public static List gradingStudents(List grades) { // Write your code here List finelRes = new ArrayList(); for (int i=0 ; i 2){ finelRes.add(grades.get(i)+(5-grades.get(i)% 5));
    }else{ finelRes.add(grades.get(i)); } } return finelRes;

    }
    

    }

  • + 0 comments
    function gradingStudents(grades: number[]): number[] {
        let results: number[] = [];
        
        for (let index = 0; index < grades.length; index++) {
            const grade: number = grades[index];
            
            if (grade < 38){
                results.push(grade);
                continue;
            }
            
            const nextMultiple: number = Math.ceil(grade / 5) * 5;
            const difference: number = Math.abs(nextMultiple - grade);
            
            if (difference < 3) results.push(nextMultiple);
            else results.push(grade);
        }
        
        return results;
    }
    
  • + 0 comments
    def gradingStudents(grades):
        final_grades = []
        for marks in grades:
            if marks < 38:
                final_grades.append(marks)
                continue
            next_multiple = 5*((marks//5) + 1)
            if next_multiple - marks < 3:
                final_grades.append(next_multiple)
            else:
                final_grades.append(marks)
        
        return final_grades
    
  • + 0 comments

    Grading is vital for tracking academic progress, yet it often fails to capture creativity, effort, or personal growth. Similar to how Newswirred highlights continuous innovation and forward thinking, grades should be viewed as milestones rather than verdicts. They serve as stepping stones, encouraging students to keep improving, exploring new ideas, and developing the resilience needed for lifelong learning.

  • + 0 comments

    Java

     public static List<Integer> gradingStudents(List<Integer> grades) {
        // Write your code here
        List<Integer> finalGrades = new ArrayList<>();
        for (Integer grade : grades) {
            int roundOff = grade%5;
            if(grade>=38 && roundOff>2){
                grade+=(5-roundOff);
            }
            finalGrades.add(grade);
        }
        return finalGrades;
        }