https://exercism.org/tracks/cpp/exercises/making-the-grade/
Hey there.
I'm a bit stuck at the 1. task of this exercise called "making-the-grade" where I need to perform a type cast for each member of an given array.
Even though the hints suggest to use a while loop and some vector methods to solve this, I kind of don't get the hang of it.
What I tried
// Round down all provided student scores.
std::vector<int> round_down_scores(std::vector<double> student_scores) {
// TODO: Implement round_down_scores
int i = 0;
while(i < student_scores.size()){
student_scores[i] = static_cast<int>(student_scores[i]);
i++;
}
return student_scores;
}
I'm familiar with looping over things but for some reason I get conversion error as seen in the screenshot.
I would appreciate any additional hints or ways to think about it so I can solve it.