Hello all,
I am trying to figure out how to create new class objects when the user is asked if he/she would like to.
What I have is a program we have to write that takes a certain number of students and keeps track of their name, assignments, and the grade for each assignment.
I figure I would create a class called Students and for each student, there will be a class object..
Ex: class students
{
public:
int studentID;
string firstName
string lastName
vector <string> assignments<x>
vector <int> grades<x>
};
students.student1
students.student2
or
students.0168283 (student ID)
The question is, how do I dynamically create the class objects such as students.student1 and students.student2 depending on if the user wants to create additional ones.