Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In this assignment, you will implement an interactive quiz with two pes of quest

ID: 3568563 • Letter: I

Question

In this assignment, you will implement an interactive quiz with two pes of questions: multiple choice questions and short answer questions You will be working with the following inheritance hierarchy. Question MultipleChoice ShortAnswer Question Question Note that Question should be an abstract base class. The derived classes of Question are the Question and ShortAnswer Question classes Think about what should go into each of these classes. Specifications The implementation of this assignment must follow these specifications Your quiz must work interactively. This means you will use cin to get input from the user. The two types of questions work as follows: 1. Multiple choice questions. You will need to print out the question and then the multiple choices. Then, prompt for input from the user. The user will enter the letter corresponding to their choice. If the letter matches the true answer, let the user know that the answer is correct. Otherwise, let the user know that their answer is incorrect and print out the correct answer 2. Short answer questions. You will need to print out the question then prompt the user for an answer. The user will then enter the answer. The answer is correct if it matches the true answer. If the letter matches the true answer, let the user know that the answer is correct. Otherwise, let the user know that their answer is incorrect and print out the correct answer. A single file contains questions for the quiz. These questions may be multiple choice or short answer. The questions file consists of a series of question "blocks with one block per question

Explanation / Answer

1.
True. If answer > userinput, then it will return greater than 1 and less than 0 vice versa

2.
transform(answer.begin(), answer.end(), answer.begin(), std::tolower);
transform(userinput.begin(), userinput.end(), userinput.begin(), std::tolower);
answer.compare(userinput);

3.
char tab2[1024];
strcpy(tab2, s.c_str());
int a = atoi(tab2);

4.
ifstream myFile;
myFile.open("filename.txt");
getline(myFile,userInput);