Write a class called Exam that contains the following private member fields: int
ID: 3674575 • Letter: W
Question
Write a class called Exam that contains the following private member fields:
int NumQuestions;
Question* questions; // a dynamically allocated array of Question objects
double score;
This class should have appropriate constructor(s), a destructor, and at least the following two public member functions:
void takeExam(); // displays all questions and prompts the user to input
// answers to each question.
double getScore(); // returns score on exam after exam is taken
It is up to you to decide how to add questions to the exam. You can either do this using constructors or through member setter functions.
Write a main function that creates an exam with at least 3 questions (the topic can be anything you like). Then call the takeExam method and allow the user to take it. Once complete, you should print out the user’s score.
Your solution should consist of a header (.h) file with class definitions and a source (.cpp) file with your method implementations and main function.
Explanation / Answer
Hi with the reference to your question below i have written a Quiz code with a switch case of random generating question and printing the resulting score,
001 #include <ctime>Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.