Colorado Technical University CS115
Date:18th October 2017
Programmer:Chris Puerta
Write a C++ program to read in various types of test questions (multiple choice and True/False) from a test bank (text file), and load the questions into an array of questions. Once the test bank has been loaded, simply iterate over the array of questions and have each question printed out to the screen.
The test bank (text file) will have the following format:
Line 1 will be an integer value, indicating how many questions in the file
Each question will start with a line that starts with either "MC" or "TF" followed by a space and then the point value of the question.
The next line will be the actual question.
If the question was True/False,…show more content… " << "The Correct Answer Is: " << answer << endl; cout << "------------------------------------------" << endl; } } ////////////////////////////////////////////////////////////////////////////////////// //multiple choice question handling: //*Each question will start with a line that starts with either "MC" or "TF" //followed by a space and then the point value of the question. else if (questionType == "MC") { string options; inFile.ignore(); //*The next line will be the actual question. getline(inFile, question); //*The following line will be an integer value indicating how many choices will be provided for that question. inFile >> questionOptions; cout << "------------------------------------------" << endl; //*The following lines will be the choices. There will never be more than 6 choices. cout << "Question: " << question << endl; for (int i = -1; i < questionOptions; ++i) { getline(inFile, options); cout << options << endl; } //*The final line following the choices will be the answer: "A" or "B" or "C" or "D" or "E" or "F". getline(inFile,