Challenge 3: Find the Highest Achiever
Given multiple subject files find the student who has the maximum total marks.
We'll cover the following
Problem Statement
Implement a function findTopper()
that takes input from three subject files: math.csv
, english.csv
and science.csv
, and find the index of the student that has scored the maximum total marks adding all three of its marks.
Input
Three files: math.csv
, english.csv
and science.csv
Output
Index of the highest scoring student
Sample Input
math.csv
Name, Math
Andrew, 2.5
Mathew, 5.9
Dany, 1.9
Philip, 9.1
english.csv
Name, English
Andrew, 8.2
Mathew, 2.5
Dany, 7.5
Philip, 9.3
science.csv
Name, Science
Andrew, 5.2
Mathew, 9.5
Dany, 7.1
Philip, 1.9
Sample Output
4
Test Yourself
Write your code in the given area. If you get stuck, you can look at the solution.
main.r
math.csv
english.csv
science.csv
findTopper <- function(){# Write your code here}
In the next lesson, we give a brief overview of the solution to this problem.