Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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) coutStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started