1) Assume that we want to build an application for special type of exams. The exam...
Fantastic news! We've Found the answer you've been seeking!
Transcribed Image Text:
1) Assume that we want to build an application for special type of exams. The exam includes True/False questions. The number of questions per exam varies from one exam to other. Given below Question class, where each True/False question has a text and a correct answer. Assume the class is implemented and ready for use: class Question { public: Question(string, bool); Question(); -Question(); void Set Text(string); string Get Text(); void SetAnswer(bool); bool GetAnswer(); private: string text; bool correctanswer; Write a new class called Exam. In this class, the exam has variable number of questions. In the Exam class, please define the following: 1. Two member variables, one called count of type int which will have number of questions in the exam, and other member variable called questions of type Question that will track the questions of the exam. Questions member variable should allow a dynamic array of questions. (5 points) 2. A constructor Exam(int num) where num is the number of questions in exam. (6 points) 3. A destructor (5 points) 4. A member function called void LoadQuestions(), this function will load the exam questions from user input. The user will be asked to insert a text and a correct answer for each exam question. (10 points) 5. A member function called Question GetQuestion(int question_index) which receives the index of the question and returns the exam Question of that index. (5 points) 6. A member function called int GetCount() which returns the number of questions in the exam. Note, make this function read only which means cannot modify Exam class objects. (5 points) Q2) Assume that the previous two classes (Question and Exam) are implemented and ready for use. Write a new class called Student Answer that will track students' answers for specific tests. The class prototype is as the following: class StudentAnswer { public: Student Answer(Exam *); -Student Answer(); void TakeExam(); float GetScore(); private: Exam* taken_exam; bool * answers; Note that the taken_exam member variable is used to track which exam is being taken. The answers member variables is used to track the student's answers of the taken_exam. Write the following functions: 1. The constructor StudentAnswer(Exam *) (6 points) 2. The member function TakeExam which will loop through exam questions one by one, and ask the student to enter answer for each one (T for true and F for false) and store student's answers inside answers member variable (array). (10 points) 3. The member function GetScore which will return the score assume the exam has been taken and answers are stored. (10 points) Write a main function that uses the Exam and StudentAnswer classes and does the following: 1. Create two exam objects, one called math with 30 question and one called OOP with 40 questions. Load questions for each one. (10 points) 2. Create one student answer SA1 for the math exam and another student answer SA2 for the OOP exam. Collect answers by calling take test for each one. Print final scores for each test. (10 points) 1) Assume that we want to build an application for special type of exams. The exam includes True/False questions. The number of questions per exam varies from one exam to other. Given below Question class, where each True/False question has a text and a correct answer. Assume the class is implemented and ready for use: class Question { public: Question(string, bool); Question(); -Question(); void Set Text(string); string Get Text(); void SetAnswer(bool); bool GetAnswer(); private: string text; bool correctanswer; Write a new class called Exam. In this class, the exam has variable number of questions. In the Exam class, please define the following: 1. Two member variables, one called count of type int which will have number of questions in the exam, and other member variable called questions of type Question that will track the questions of the exam. Questions member variable should allow a dynamic array of questions. (5 points) 2. A constructor Exam(int num) where num is the number of questions in exam. (6 points) 3. A destructor (5 points) 4. A member function called void LoadQuestions(), this function will load the exam questions from user input. The user will be asked to insert a text and a correct answer for each exam question. (10 points) 5. A member function called Question GetQuestion(int question_index) which receives the index of the question and returns the exam Question of that index. (5 points) 6. A member function called int GetCount() which returns the number of questions in the exam. Note, make this function read only which means cannot modify Exam class objects. (5 points) Q2) Assume that the previous two classes (Question and Exam) are implemented and ready for use. Write a new class called Student Answer that will track students' answers for specific tests. The class prototype is as the following: class StudentAnswer { public: Student Answer(Exam *); -Student Answer(); void TakeExam(); float GetScore(); private: Exam* taken_exam; bool * answers; Note that the taken_exam member variable is used to track which exam is being taken. The answers member variables is used to track the student's answers of the taken_exam. Write the following functions: 1. The constructor StudentAnswer(Exam *) (6 points) 2. The member function TakeExam which will loop through exam questions one by one, and ask the student to enter answer for each one (T for true and F for false) and store student's answers inside answers member variable (array). (10 points) 3. The member function GetScore which will return the score assume the exam has been taken and answers are stored. (10 points) Write a main function that uses the Exam and StudentAnswer classes and does the following: 1. Create two exam objects, one called math with 30 question and one called OOP with 40 questions. Load questions for each one. (10 points) 2. Create one student answer SA1 for the math exam and another student answer SA2 for the OOP exam. Collect answers by calling take test for each one. Print final scores for each test. (10 points)
Expert Answer:
Answer rating: 100% (QA)
Question 1 Code class Exam public Examint num Exam void LoadQuestions Question GetQuestionint questionindex int GetCount const private int count Question questions ExamExamint num count num questions ... View the full answer
Related Book For
Statistics Unlocking the Power of Data
ISBN: 978-1118583104
1st edition
Authors: Robin H. Lock, Patti Frazer Lock, Kari Lock Morgan, Eric F. Lock, Dennis F. Lock
Posted Date:
Students also viewed these mathematics questions
-
Suppose that we want to investigate the question Does voter turnout differ by political party? How might we collect data to answer this question? What would the cases be? What would the variable(s)...
-
Suppose that we want to store digitized audio information in a binary file. An audio signal typically does not change much from one sample to the next. In this case, less memory is used if we record...
-
Suppose that we want to translate constant expressions into the postfix, or reverse Polish notation of logician Jan ukasiewicz. Postfix notation does not require parentheses. It appears in...
-
On December 1, 2011, Lavender Manufacturing Company (a corporation) purchased another company's assets, including a patent. The patent was used in Lavender's manufacturing operations; $49,500 was...
-
Consider the titration of the weak acid HA with NaOH. At what fraction of Ve does pH = pKa - 1? At what fraction of Ve does pH pKa - 1? Use these two points, plus Ve, and 1.2Ve to sketch the...
-
In July 2016, Surecut Sawmills buys office furniture for $570,000. a. Compare cost-recovery deductions using maximum, minimum, and intermediate methods over the recovery period of the equipment. b....
-
The current advertising campaign for a major automobile brand will be changed if fewer than 70 percent of the consumers like it. a. Formulate the null and alternative hypotheses. b. Which statistical...
-
You plan to open a small business for manufacturing pet collars, leashes, and harnesses. You have found a workshop space you can use for sewing your products. After some research and planning, you...
-
RFL versus Boxhouse - Seller's Information James Murphy, Sales Manager and Scott Campbell, Sales Representative for Boxhouse Ltd were developing a strategy for a negotiation session to be held with...
-
Imagine that you have extracted an unmyelinated neuron and have placed it in a sterile petri dish filled with a solution mimicking its natural extracellular envirnoment. you artificially stimulate...
-
Explain with suitable examples why the support department costs are allocated to operating department? Briefly explain any one method of such allocation with numerical examples.
-
1. From a line manager: I attach a collage of job advertisements that prove my contention that we are seriously underpaying my key staff. How do you reply? 2. From the HR director to the head of...
-
Briefly describe the importance of trust,collegiality,fairness and accountability in research collaborations. Explanation and conclusion please
-
3. Long-Term Financial Decision - Breakeven Point Strong Key Pte.Ltd., manufactures a key for houses with the selling price $7/per unit. Each key has variable cost per unit $4, Fixed Cost $60.000/per...
-
How nurses who belong to this organization can demonstrate collegiality- Provide specific examples within your organization.?
-
Discuss the role of the educator in promoting collegiality, civility, and professional socialization in academic and clinical education settings.?
-
A non-uniform electric field is given by the following equation: N . (2) 6- (4)+((3)9) What is the total charge contained within the cube shown in the figure? x=1 m z=1 m Z x y=1m y=2m
-
Evaluate each logarithm to four decimal places. log 0.257
-
Test H 0 : μ 1 = μ 2 vs H a : μ 1 > μ 2 using the paired data in the following table: Use a t-distribution and the given matched pair sample...
-
It is generally recommended that adults sleep at least 8 hours each night. One of the authors recently asked some of her students (undergraduate and graduate students at Harvard) how many hours each...
-
The Scholastic Aptitude Test (SAT) was taken by 1,547,990 college-bound students in the class of 2010. The test has three parts: Critical Reading, Mathematics, and Writing. Scores on all three parts...
-
Evaluate the shape factor \(\phi_{B}^{f}\) for strength-limited design in bending of a square box section of outer edge-length \(h=100 \mathrm{~mm}\) and wall thickness \(t=3 \mathrm{~mm}\). Is this...
-
Derive the expression for the shape-efficiency factor \(\phi_{B}^{e}\) for stiffness-limited design for a circular tube with outer radius \(5 t\) and wall thickness \(t\), loaded in bending (Fig....
-
Derive the expression for the shape-efficiency factor \(\phi_{B}^{e}\) for stiffness-limited design for a square box section of wall thickness \(t\), and height and width \(h_{1}=10 t\) bent about...
Study smarter with the SolutionInn App