CPA practice question 29 of 30

What is the output of the program? #include #include using namespace std; class First { string name; public: First() { name = "Alan"; } void…

Choose your answer, then check it against the explanation.

What is the output of the program? #include #include using namespace std; class First { string name; public: First() { name = "Alan"; } void setName(string n) {this?>name = n;} void setName() {this?>name = "John";} void Print(){ cout <setName(); t?>Print(); t = ob2; t?>setName("Steve"); ob2?>Print(); }
Answer options
Question 29 of 30

Keep practicing

Take the free CPA practice test

Ten exam-style questions with answers and explanations, plus the exam facts and study guides.

Start the free practice test

More questions

Other CPA practice questions

Scroll to Top