Did I answer correctly?

Jun 1, 2013 at 9:55pm
Would you agree that I answered these conceptual questions about struct and polymorphism correctly?

struct allows:
a)member function definition
b)virtual constructors & inheritance
c)public & private visibility specifiers

I chose all of the above

polymorphism allows:
a)create collection of derived classes that are of different types
b)override base class behavior using virtual functions
c)share common data variables via base class

I chose c) only
Jun 1, 2013 at 10:28pm
your answer to the first question is correct.

the answer to the second question should be b).

your choice of c)
"share common data variables via base class" would define inheritance.
Last edited on Jun 1, 2013 at 10:34pm
Jun 1, 2013 at 11:28pm
I looked at this link:
http://www.cplusplus.com/forum/beginner/2530/

"The advantages are
1) it reduces overhead when handling multiple objects of similar type.
2) it allows new objects to be added to previously written code without modifying the original code.
3) it keeps private stuff private.
4) it is easier to maintain large systems"

would polymorphism be a)?
Jun 1, 2013 at 11:57pm
I just now noticed that the question says 'allows'. Unfortunately neither a b or c 'clearly' convey what polymorphism allows. a) would be the (closest) answer.

I originaly chose the answer b) since virtual methods is what allows polymorphism.
Jun 2, 2013 at 12:00am
ok thanks for helping out
Topic archived. No new replies allowed.