Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Consider the following declaration for the Soldier class. class Soldier { public: Soldier ( ) ; void set _ rank ( string new _ rank
Consider the following declaration for the Soldier class.
class Soldier
public:
Soldier;
void setrankstring newrank;
string getrank const;
private:
string rank;
;
The Major class inherits from the Soldier class. For the Major class to override the setrank function, what must be done?
Question options:
The Major class must define the function void setrankstring newrank
The Major class must define the function void overridesetrankstring newrank
The Major class must define the function void overridestring setrank, string newrank
The Major class cannot override the setrank function.
Step 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