Question: Only need part C. 5. Constructors and Destructors (10.0%) Place your answers to the questions below in the same file as your answers to problem
Only need part C.



5. Constructors and Destructors (10.0%) Place your answers to the questions below in the same file as your answers to problem 1 and 2 (i.e. hw1.txt). Suppose you were given the following class to model your academic record including your major and overall GPA which uses the Rational class you wrote previously. #ifndef RECORD_H #define RECORD_H #include "rational.h" class Record public: Record(const Rational& major, const Rational& overall); -Record(); const Rational& majorGPAC const; const Rational& overallGPA const; private: Rational major_; Rational overall_; #endif Further assume that print statements are added to the constructors and destructor of the Rational class as follows: Rational in the default and initializing constructor(s) . --Rational in the destructor Copy Rational in the copy constructor Nothing is printed in the assignment operator(s) Part (a) If the Record constructor is as shown below, what will be printed when a new Record object is constructed? Record: : Record(const Rational& major, const Rational& overall) cout
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
