if the model in the view is representing all the courses of one student, then you can just sum the total marks and divide it by number of courses to get the average of him:
<p>
AVERAGE MARKS: @(Model.Sum(x=>x.Mark)/Model.Count())
</p>
and your ViewModel is not well defined, technically your ViewModel should have all the properties that needs to be used in View, so what would be better is to include a property of Average in your ViewModel and your view should be just displaying that, not calculating it in view.
A better ViewModel would be something like:
public class StudentCoursesViewModel
{
public List<Course> Courses {get;set;}
public AverageMarks
{
get { return (Course.Sum()/Courses.Count()); }
}
}
public class Course
{
public int Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public int Code { get; set; }
public string CourseName { get; set; }
public int Credit { get; set; }
public int Mark { get; set; }
public string Grade { get; set; }
}
Hope it helps!