Find the grade of the student based on the marks obtained in five subjects. Let the grade be calculated based…