Course Solutions Uncategorized (Solved) : C Question Please Explain Detail Want Understand Clearly Thank Much Program Outputs 10 Li Q32812688 . . . .

(Solved) : C Question Please Explain Detail Want Understand Clearly Thank Much Program Outputs 10 Li Q32812688 . . . .

 

C++ question. Please explain in detail if you can. I want tounderstand it clearly. Thank you very much.

This program outputs 10 lines. What are they? Why?

#include <iostream>
#include <string>
using namespace std;
class Student {
public:
Student() {
cout << “Student(), constructor called.” << endl;
}
explicit Student(string stuName) : stuName(stuName) {
cout << “Student(stuName), constructor called.” <<endl;
}
~Student() {
cout << “~Student(), destructor called.” << endl;
}
string getName() {
return this->stuName;
}
virtual void sayHi() {
cout << “Student: Hi!” << endl;
}
void sayHello() {
cout << “Student: Hello!” << endl;
}
private:
string stuName{ “Student” };
};
class CSStudent : public Student {
public:
CSStudent() {}
explicit CSStudent(string stuName) : Student() {}
void sayHello() {
cout << “CSStudent: Hello!” << endl;
}
};
class CSStudent340 : public CSStudent {
public:
CSStudent340()

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post