Time to put your arrays and vectors knowledge to work! You'll build a program that stores student names and grades, then computes useful statistics.
YOUR TASK
Create a program that stores 5 student names and their grades in vectors, then:
Calculates and displays the class average
Finds and displays the highest grade
Finds and displays the lowest grade
Displays all students sorted by grade (highest first)
Hint 1 — Structure
Use two parallel vectors: vector<string> names = {"Alice","Bob","Carol","Dave","Eve"}; vector<int> grades = {88, 72, 95, 60, 84};
Loop to compute sum, then divide by grades.size() for the average.
Hint 2 — Sorting
Use a simple bubble sort or selection sort on the grades vector, keeping names in sync.
Or use #include <algorithm> — but you'll need to sort pairs to keep names and grades together: vector<pair<int,string>> students;
Then sort(students.rbegin(), students.rend()); sorts descending.
Console initialized...
Ready for Project 1: Student Grade Book
> Build your solution and hit "Check My Code"
> Once it passes, the Complete button will activate!