Taking a collection of qualifications as a List, obtain the average grade of the students who have passed the exam.
You must create an infix function called average on a list of Doubles. It accepts a parameter – the markLimit score – as a double and returns a double value – the average value of the list elements greater than or equal to this limit.
val listOfGrades = listOf(5.5, 4.6, 3.0, 2.5, 10.0, 9.9, 8.75)
println(listOfGrades average 5.0)