Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

C++ Institute Exam CPA-21-02 Topic 1 Question 16 Discussion

Actual exam question for C++ Institute's CPA-21-02 exam
Question #: 16
Topic #: 1
[All CPA-21-02 Questions]

Which code line inserted instead of the comment below will cause the program to produce the expected output?

Show Suggested Answer Hide Answer
Suggested Answer: A, B

Contribute your Thoughts:

Sherrell
1 months ago
I wonder if the expected output involves a surprise dance party. If so, I'm going with option B --> A::print(); *dances awkwardly*
upvoted 0 times
User 1: I think option A) ob2.A::print(); is the correct one.
upvoted 0 times
...
...
Markus
1 months ago
This is a real head-scratcher. I'm just going to flip a coin and hope for the best. *flips coin* Aha, option D it is!
upvoted 0 times
...
Letha
1 months ago
Hold on, the question says to use the 'expected output', so I'm guessing we need to call the print() method of the derived class B. Option C for the win!
upvoted 0 times
Arminda
1 days ago
Let's go with option C then, it seems to be the most logical choice.
upvoted 0 times
...
Edna
2 days ago
I'm not sure, but I think option C is the safest bet.
upvoted 0 times
...
Reynalda
29 days ago
But what about option A? Wouldn't that also work?
upvoted 0 times
...
Ulysses
1 months ago
I think you're right, option C seems to be the correct choice.
upvoted 0 times
...
...
Carman
1 months ago
Wait, aren't we supposed to use the scope resolution operator to access the print() method of A? I'm leaning towards option B.
upvoted 0 times
...
Natalya
2 months ago
But if you look at the image, it clearly shows that ob2 is an object of class A, so A) ob2.A::print() makes more sense
upvoted 0 times
...
Judy
2 months ago
Hmm, looks like we need to call the print() method of the base class A, not B. I think option A is the way to go.
upvoted 0 times
Tandra
21 days ago
Yes, option A will call the print() method of the base class A.
upvoted 0 times
...
Jennifer
28 days ago
I agree, option A is the correct one.
upvoted 0 times
...
...
Kizzy
2 months ago
I disagree, I believe the answer is C) ob2.B::print()
upvoted 0 times
...
Natalya
2 months ago
I think the correct answer is A) ob2.A::print()
upvoted 0 times
...

Save Cancel