Help create this program!

This is my first year taking a C++ class and I don't quite really understand a lot of whats going on. My teacher told us that we need to create a student database which is searchable by student ID. I don't know how to build it and I really need your help. Any help is much appreciated.



Create a student database which is searchable by student ID.

You will create an array of structs, which will include First Name, Last Name, Student ID, GPA and Grade Level.

struct Students
{
string fname, lname;
long studentID;
int grade;
double GPA;
}

Students myStudents[10];

The data will be imported from a data file into an array (10 items, see attached file student1.txt)

User the fstream library
ifstream, ofstream,

Once data is imported into the array a menu will be displayed to the user to search for student ID or 0 (zero) the program, using a Do-While loop.

Use this code to open, read and close from file into array:
myFile.open("student1.txt");

while (myFile >> myStudents[index].first>>myStudents[index].last>> myStudents[index].studentID >> myStudents[index].grade >> myStudents[index].GPA )
{

index++;

}
myFile.close();

student1.txt -
Waldo Mccart 101 9 3.2
Eilene Gilkes 202 8 4.0
Fransisca Grullon 303 9 2.2
Mireya Brust 404 9 2.0
Kami Jeanlouis 505 7 3.5
Roosevelt Roussel 606 9 1.2
Lelah Drapeau 707 8 3.3
Fermin Phegley 808 9 2.9
Claud Mehaffey 909 8 2.8
Shantay Arroyo 110 9 2.2
Topic archived. No new replies allowed.