Question: Part 1: Begin with the running program from your Phase 4 Individual Project where the examination question class hierarchy was fully implemented in a menu-driven

Part 1: Begin with the running program from your Phase 4 Individual Project where the examination question class hierarchy was fully implemented in a menu-driven program. An exam class was developed to load the exam from a file and display each question to the screen. Part 2: Modify the program from part 1 to change the menu to the following: Load an exam Take an exam Show exam results Quit Choice 1: No functionality change. Load the exam based upon the user's prompt for an exam file. Choice 2: The program should display a single question at a time and prompt the user for an answer. Based upon the answer, it should track the score based upon a successful answer. Once a user answers the question, it should also display the correct answer with an appropriate message (e.g., "Good job" or "Better luck next time") Upon completion of the exam, the program should return the user to the menu. Choice 3: The program should display the total points available and the total points scored during that exam. A percentage score should also be displayed. (Optional: if you choose to track which problems were missed, you could display that information for the user.) Choice 4: No change to this functionality from the Phase 4 IP. You should consider creating an additional class Student that will track student's score through methods such as addPointsPossible, addPointsScored, getPointsPossible, and getPointsScored. You should also enhance your Exam class to include methods getPointValue and getAnswer. You may also want to add a method to only display one question at a time, such as displayQuestion.#include #include #include #include using namespace std; class Question // super class { public: string getQuestion()//gets the question { return question; } virtual int getValue() //gets the point value of the question { return value; } virtual string getQuestionType()// gets the type of question { return questiontype; } virtual void setQuestion(string answer, int value) { } virtual void setNewQuestion(string answer, int value) { } virtual void printOptions() { } virtual string getAnswer() { return answer; } private: string question, answer; int value; string questiontype; }; class QuestionTF: public Question// class for true and false questions { public: void setQuestion(string theQuestion, int pointValue) { string theAnswer; questiontype = "TF"; question = theQuestion; value = pointValue; options = "true/false"; //get the answer from the file getline(cin,theAnswer); answer = theAnswer; } void setNewQuestion(string theQuestion, int pointValue) { string theAnswer; questiontype = "TF"; question = theQuestion; value = pointValue; options = "true/false"; //get the answer from user cout<<"Enter answer true/false "; getline(cin,theAnswer); answer = theAnswer; } int getValue() //gets the point value of the question { return value; } string getQuestionType()// gets the type of question { return questiontype; } void printOptions()//prints the options for that question { cout<>choice; return choice; }

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 Databases Questions!