Professional Documents
Culture Documents
=======================
This assignment is project Grades2, as part of solution Grades.
For this project the class Grades is going to:
-
8. In main():
Update main()
===============
{
}
// as a nested struct
// as a nested struct
33. This public function, of type void, when called from main()
will display information about the current class-selection,
from the settings of the two calls from SelectClass():
- update first the .h file with this public void function;
- implement the function to display:
className; college name; city; semester; time; textbook
title, author, edition;
- call it from main().
34. Compile and run.
35. At the end of DisplayClassInfo() add now one more code
segment, to display the publishing-year, like:
if(program.textbook.year == "2012")
cout << " - Eighth" << endl;
else if(program.textbook.year == "2013")
cout << " - Ninth" << endl;
36. Compile and run.
Instantiate a third object
==========================
37. Instantiate a third object inside main():
Grades myThirdClass { "CIT", 3 };
38. Compile and run. Is the parameter-constructor called ?
Include a destructor
====================
39. Include as public the destructor
~Grades();
and implement it as
Grades::~Grades()
{
cout << "Destructor called for object "
<< objectID << endl;
}
The destructor will be automatically called by run-time when
the objects are detected as no longer being used by your code.
40. Compile and run.
Is the destructor automatically called when main() ends ?
Are the objects automatically destroyed in reverse order of
instantiation ?
41. Update the Header at the top of the source-file.
SEND TO INSTRUCTOR
- THE SOURCE/HEADER FILES
- THE FILE WITH CAPTURED OUTPUT-SCREEN