Put your knowledge of structs, vectors, file I/O, and algorithms to work in one complete program. You'll build a grade tracker that stores student records, writes them to a file, reads them back, finds the top scorer, and prints a summary.
YOUR TASK
Write a program that does all of the following:
Defines a Student struct with fields string name, int grade, and string subject.
Stores 4 hardcoded students in a vector<Student> (use the values in the expected output below).
Writes all students to a file called grades.txt, one per line in the format: Name | Grade | Subject
Reads the file back and prints each line to the console prefixed with Student:
Finds the student with the highest grade and prints their name prefixed with Top student:
Student: Alice | 88 | Math
Student: Bob | 95 | Science
Student: Carol | 76 | History
Student: Dave | 82 | English
Top student: Bob
Total students: 4
Code Editor
Ready
Output
Console
Console initialized...
Ready for Project 5: Student Grade Tracker
> Build your solution and hit "Check My Code"
> Once it passes, the Complete button will activate!