Class DOB {
public:
getDOB()
setDOB(string DOB)
private:
//atributes
1 2 3 4 5 6 7 8
Class DOB {
public:
getUnits()
setUnits(int Unit)
private:
//atributes
How do I incorporate the DOB and Unit classes into the student class so that they're not excluded from the vector because currently the vector does not contain the DOB and Unit.
You haven't shown us the full declaration for Student, so it's impossible to tell if DOB and Units (which you also did not show) are included in Student.
DOB and Units are attributes of a student they should be members of your Student class.
Currently DOB and Units are not included in Student. The only thing student has are setters and getters for the student first name and last name. DOB and Units also only have their own setters and getters.
The problem I'm having is figuring out how to include DOB and Units into Student. I could put DOB and Units into the Student class but I want to learn to work with different classes.
I could put DOB and Units into the Student class but I want to learn to work with different classes.
By doing so, you are working with classes. Doing so is an important principle called composition. If you can say a Student HAS A DOB and a Student HAS A Units, then you can be pretty sure those belong as members of Student.