Last edited on
In Module you have this vector<Assessment>& ppAssessment. The type of the data of the vector will not change even if you assign Coursework or other derived classes.

In case of this ppAssessment.push_back(*NewCw); only the Assessment data is copied, anything else is ignored.

You should store the pointer not the actual objects. And by the way: Storing a reference to an object (like ppAssessment) is rarely a good idea. In this case entirely needless.
could you explain again sorry, i don't quite understand.

you said to store the pointer not the objects. perhaps you could show an example in the code?

i tried to use a point within the vector data type vector<Assessment*> ppAssessment;
and i tried doing *ppAssessment.push_back(NewCw)

surely the void Module::addCourseworks(){} method should be fine because it outputs the title, mark and weighting to the console which its meant to do. but the void Module::addExam(){} method outputs the title and mark. but doesnt ask for the weighting like it does in courseworks.

Last edited on
i tried doing *ppAssessment.push_back(NewCw)
Remove the leading *.

but doesnt ask for the weighting like it does in courseworks.
In Exam you implemented setWeighting(double examWeighting) not enterWeighting(double weighting).
Topic archived. No new replies allowed.