Independence Day Deal! Unlock 25% OFF Today – Limited-Time Offer - 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
2 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
Orville
8 days ago
User 3: I agree with Carolynn, option A) ob2.A::print(); seems like the right choice.
upvoted 0 times
...
Carolynn
14 days ago
User 2: I'm not sure, but I believe option C) ob2.B::print(); might be the answer.
upvoted 0 times
...
Georgene
15 days ago
User 1: I think option A) ob2.A::print(); is the correct one.
upvoted 0 times
...
...
Markus
2 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
2 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
16 days ago
Let's go with option C then, it seems to be the most logical choice.
upvoted 0 times
...
Edna
17 days ago
I'm not sure, but I think option C is the safest bet.
upvoted 0 times
...
Reynalda
1 months ago
But what about option A? Wouldn't that also work?
upvoted 0 times
...
Ulysses
2 months ago
I think you're right, option C seems to be the correct choice.
upvoted 0 times
...
...
Carman
2 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
1 months ago
Yes, option A will call the print() method of the base class A.
upvoted 0 times
...
Jennifer
1 months 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
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77