Grading Students

  • + 0 comments

    Jva 15 solution public static List gradingStudents(List grades) { // Write your code here List roundedLst = new ArrayList();

    for(Integer grade:grades){
        int tmp=0;
        if(grade>=38){
          tmp = grade%5;
          if(5-tmp <3){
            grade = grade + (5-tmp);          
          } 
        } 
        roundedLst.add(grade);
    }
    
    
    return roundedLst;
    }