# Grading Students Hacker Rank Solution with Explanation Grading Students Hacker Rank Solution with Explanation

Grading student hackerrank solution with explanation, first lets see what the problem is :

## Grading Students Hacker Rank Problem:

```HackerLand University has the following grading policy:

1. Every student receives a grade in the inclusive range from 1 to 100.

Sam is a professor at the university and likes to round each student's grade
according to these rules:

1.If the difference between the grade and the next multiple of 5 is less
than 3 , round up to the next
multiple of 5.
2.If the value of grade  is less than 38 , no rounding occurs as the result
will still be a failing grade.

Examples

1. grade = 84 round to85 (85 - 84 is less than 3)
2. grade = 29 do not round (result is less than 40)
3. grade = do not round (60 - 57 is 3 or higher)

Given the initial value of  grade for each of Sam's n students, write code
to automate the rounding
process.

Function Description

Complete the function gradingStudents in the editor below.

Returns

int[n]: the grades after rounding as appropriate

Input Format

The first line contains a single integer,n , the number of students.
Each line i of the n subsequent lines contains a single integer, grades[i].

Constraints

1&lt;= n &lt; =60
```

### Grading students Hackerrank solution JavaScript:

```function gradingStudents(grades) {
let  count = 5 - grade % 5;
if (grade &gt;= 38 &amp;&amp; count &lt; 3)
}
});
}
```

### Grading students Hackerrank solution Python:

```def gradingStudents(grades):
if 5 - diff &lt; 3:
```

### Grading students Hackerrank solution C#:

```public static List GradingStudents(List grades)
{
for (int i = 0; i &lt; grades.Count; i++) { int diff = 5 - grades[i] % 5; if (grades[i]
&gt;= 38 &amp;&amp; diff &lt; 3)