Question 3 (5) ============== The Foo Family -------------- .. plantuml:: @startuml interface IFoo { + bar() } class AFoo { + bar() } class BFoo { + bar() } IFoo <|.. AFoo IFoo <|.. BFoo @enduml .. literalinclude:: code/the-foos.h :language: c++ :caption: :download:`code/the-foos.h` Usage ----- **Given the following usage:** .. literalinclude:: code/polymorphic-access.cpp :language: c++ :caption: :download:`code/polymorphic-access.cpp` **Which of the following statements is true?** .. list-table:: :align: left :header-rows: 1 * * Statement * True * * A call as shown gives the output as shown .. code-block:: console $ ./program a AFoo::bar() 42 * .. list-table:: :align: left :header-rows: 1 * * Statement * True * * A call as shown gives the output as shown .. code-block:: console $ ./program b BFoo::bar() 666 * .. list-table:: :align: left :header-rows: 1 * * Statement * True * * A call as shown will do nothing because ``foo`` is null .. code-block:: console $ ./program c ...?... * .. list-table:: :align: left :header-rows: 1 * * Statement * True * * A call as shown will likely crash because ``foo`` is null .. code-block:: console $ ./program c ...?... * .. list-table:: :align: left :header-rows: 1 * * Statement * True * * However called, the program has a memory leak *