Lab Objectives: * You will practice in this lab with polymorphism. A Question Bank! In this exercise, you will implement
Posted: Thu Jun 02, 2022 8:24 am
Question Bank! In this exercise, you will implement a hierarchy of three classes that represent exam questions. Question text :string answer :string points :int default constructor parameterized constructor Setters/getters :bool is correct (string answer) ask() :void (pure virtual) (virtual) destructor TrueFalseQuestion MCQ choices size index default constructor parameterized constructor Setters/getters ask() destructor default constructor parameterized constructor ask() destructor :void Essay Question default constructor parameterized constructor ask() destructor :void :string :int int :void
a. Create an array of 10 questions. b. Ask the user to enter the number of points on each question. c. Ask the user to specify the type of question. d. Ask the user to enter the information of the question based on its type. e. Display all questions to the user and ask him to answer the questions f. Calculate the total grade. g. Define a function name compareQuestions which take two questions of any type and compare their grades to each other and print "question 1 has more credit than question 2" if the grades of the first object is greater than the number of grades in the second object, print "question 2 has more credit than question 1", otherwise print "same grade".
Lab Objectives: * You will practice in this lab with polymorphism. A a. Create an array of 10 questions. b. Ask the user to enter the number of points on each question. c. Ask the user to specify the type of question. d. Ask the user to enter the information of the question based on its type. e. Display all questions to the user and ask him to answer the questions f. Calculate the total grade. g. Define a function name compareQuestions which take two questions of any type and compare their grades to each other and print "question 1 has more credit than question 2" if the grades of the first object is greater than the number of grades in the second object, print "question 2 has more credit than question 1", otherwise print "same grade".