What is the printout of the following code?

```
#include
using namespace std;

class C
{
public:
string toString()
{
return "C";
}
};

class B: public C
{
string toString()
{
return "B";
}
};

class A: public B
{
virtual string toString()
{
return "A";
}
};

void displayObject(C *p)
{
cout << p->toString();
}

int main()
{
displayObject(&A());
displayObject(&B());
displayObject(&C());
return 0;
}
```

. BBB
b. CBA
c. CCC
d. AAA
e. ABC


c. CCC

Computer Science & Information Technology

You might also like to view...

Given the following code snippet, what line is executed immediately after line 7?

``` 1. var x = 1; var count = 20; var timer; 2. function countIt() 3. { 4. count = count – x; 5. document.write(count); 6. } 7. timer = setTimeOut('countIt()', 2000); 8. document.write("Count down: "); ``` a. line 1 b. line 2 c. line 4 d. line 8

Computer Science & Information Technology

On a 8.5 × 11 paper with 1 inch margins, there are 6.5 inches of available space to add data and labels

Indicate whether the statement is true or false

Computer Science & Information Technology

?System developers use _____ to document and trail program defects, code changes, and replacement code.

A. ?bug tracking software B. ?the obstruction generator C. ?fault promotion analysis D. ?the defect distribution policy

Computer Science & Information Technology

You can insert a logo on a form using the ____ button on the Design tab.

A. Graphic Art B. Art C. Graphic Image D. Insert Image

Computer Science & Information Technology