main.cpp

URL: http://147.64.242.52/~bennett/class/cmsc2040/fall2026/notes/inherit/code/main.cpp
 
#include <iostream>
#include "QuestionT.h"

using namespace std;

void TellAboutQuestion(QuestionT & question);
void TellAboutQuestion2(QuestionT * question);

int main() {
    //QuestionT a;

    TFQuestionT b;
    b.SetQuestion("Do you understand?");

    SpecialTFQuestionT c;
    c.SetQuestion("Did this work");

    MultipleChoiceT d;


    //TellAboutQuestion(a);
    TellAboutQuestion(b);
    TellAboutQuestion(c);
    TellAboutQuestion(d);

/*
    //TellAboutQuestion2(&a);
    TellAboutQuestion2(&b);
    TellAboutQuestion2(&c);
*/

    return 0;
}

void TellAboutQuestion(QuestionT & question){
    cout << " the type  is " << question.GetType() << endl;
    cout << " the question is ";
    question.AskQuestion();
    cout << endl;
}

void TellAboutQuestion2(QuestionT * question){
    cout << " the type  is " << question->GetType() << endl;
    cout << " the question is ";
    question->AskQuestion();
    cout << endl;
}