Question: Please do the following code in Visual Studio Code Program Purpose Derive three classes from the provided Question class: Create a TrueFalseQuestion class as a

Please do the following code in Visual Studio Code
Program Purpose Derive three classes from the provided Question class: Create a TrueFalseQuestion class as a child of the Question class. The class will contain one private bool data member for whether the answer to the question is true or false. You will include a constructor with default arguments for the question and answer, accessor and mutator functions for the private data member, and a destructor and Print function. Read the comments in the supplied truefalsequestion.h header file for more detailed requirements. Initial tests for the functionality of the TrueFalseQuestion class have been provided in the attached testtf.cpp source file. You are encouraged to create more rigorous tests. Create a ShortAnswerQuestion class as a child of the Question class. The class will contain one private string data member for the correct answer to the question. You will include a constructor with default arguments for the question and answer, accessor and mutator functions for the private data member, and a destructor and Print function. Read the comments in the supplied shortanswerquestion.h header file for more detailed requirements. Initial tests for the functionality of the ShortAnswerQuestion class have been provided in the attached testsa.cpp source file. You are encouraged to create more rigorous tests. Create a MultipleChoiceQuestion class as a child of the Question class. The class will contain three private data member: an int for the number of answer choices, a pointer to a string to hold the dynamically allocated array of answer choices, and a pointer to a bool to hold the dynamically allocated array of true/false false values denoting whether or not each of the corresponding answer choices is correct. You will include a constructor with default arguments for the data members, a copy constructor, accessor and mutator functions described in the header file, and a destructor and Print function. Read the comments in the supplied multiplechoicequestion.h header file for more detailed requirements. Initial tests for the functionality of the MultipleChoiceQuestion class have been provided in the attached testmc1.cpp and testmc2.cpp source files. You are encouraged to create more rigorous tests. Specifications - Do not modify any of the code in question.h - Add all code for the definition of the TrueFalseQuestion class to the attachedtruefalsequestion.h header file. - Include all of the necessary code for the TrueFalseQuestion class, including the implementation of all of the public member functions, in the attached truefalsequestion.cpp source file. - Add all code for the definition of the ShortAnswerQuestion class to the attached shortanswerquestion.h header file. Homework 5, CSCE 240-002 Fall 2024- Include all of the necessary code for the ShortAnswerQuestion class, including the implementation of all of the public member functions, in the attached shortanswerquestion.cpp source file. - Add all code for the definition of the MultipleChoiceQuestion class to the attached multiplechoicequestion.h header file. - Include all the necessary code for the MultipleChoiceQuestion class, including the implementation of all of the public member functions, in the attached multiplechoicequestion.cpp source file. - You are required to use pointers as data members in the MultipleChoiceQuestion class and to manage the dynamic allocation and deallocation of memory for these data members.
To test your TrueFalseQuestion class, type: make testtf - To test your ShortAnswerQuestion class, type: make testsa - To test your MultipleChoiceQuestion constructor with default arguments and Print function, type: make testmc1- To Test your MultipleChoiceQuestion copy constructor and SetAnswerChoices function, type: make testmc2
```
C multiplechoicequestion.h 1
C question.h
C shortanswerquestion.h }
C: > Users > lando > CSCE240_C++> Homework > hw5> C shortanswerquestion.h
1// ShortAnswerQuestion should be a child of the Question class
// The class should have a private string data member that holds the correct
// answer to the question. Add an accessor and mutator function for this data
// member
// Create a constructor that allows the question and answer to be
// initialized when instantiated. The question and answer parameters should
// have default arguments of "?" and "", respectively.
// Add a Print function that takes a bool parameter: void Print(bool) const;
// This fuction should create 1 or 2 lines of output to the standard output
// device, using cout.
// The first line of output should be "Question: " followed by the value of
// the question data member.
// If the Print function's argument is true, it should output a second line
// that is "Correct Answer: " followed by the value of the correct answer
// private data member.
``````
C multiplechoicequestion.h 1
C question.h
C shortanswerquestion.h
C: > Users > lando > CSCE240_C++> Homework > hw5> C question.h >...
1// definition of the Question base cla
C: >
Please do the following code in Visual Studio

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!