Question: Please transform this table into a C++ code. Separate it into a .h and .cpp files. It's derived from a Question class(ask me for the

Please transform this table into a C++ code. Separate it into a .h and .cpp files. It's derived from a Question class(ask me for the code if you need it). I will make sure i give a thumbs up!

Please transform this table into a C++ code. Separate it into a

NA question has two private member variables: correctAnswerMin, and correctAnswerMax. correctAnswerMin and correctAnswerMax define the range of values accepted as a correct answer. so, correctAnswerMin is less than or equal to correctAnswerMax.

Also, it has one mutator: setCorrectAnswer; and two accessors: getCorrectAnswerMin, and getCorrectAnswerMax.

In setCorrectAnswer function, the first argument is the value for correctAnswerMin, and the second argument is the value for correctAnswerMax. Therefore, if the first arguments value is not less than or equal to second arguments value, do not change the values of correctAnswerMin and correctAnswerMax. In addition, this class has a function called isCorrect, which given a float argument, it will return whether that float argument is between correctAnswerMin and correctAnswerMax (true or false).

Question (Base) class:

#ifndef QUESTION_H #define QUESTION_H #include using std::string;

class Question { public: Question(); Question(string quest); void setText(string quest); string getText() const; void setPoints(int points); int getPoints() const; void display() const; private: string text; int points; };

#endif

=====================================================

Question.cpp

#include "Question.h" #include #include

using namespace std;

Question::Question(): text(""), points(1){} Question::Question(string quest): text(quest),points(1){} void Question::setText(string quest){ text = quest; } string Question::getText() const{return text;} void Question::setPoints(int points){ this->points = points; } int Question::getPoints() const{return points; } void Question::display() const{ cout

Numeric-Answer question class Create a derived class for a numeric-answer question from the question base class. Use public as the access specifier for the inheritance. NAquestion -correctAnswerMin: float -correctAnswerMax: float +setCorrectAnswer(float,float): void +getCorrectAnswer Min() const: float +getCorrectAnswerMax() const: float +isCorrect(float) const: int +NAquestion() +NAquestion(string,float,float,int) +operator+(const int value): int -operator

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!