C++//NumericQuestion
<p>I'm a begginer when it comes to C++.</p>

<p>I have to write a program that asks a question and I give the answer than it checks if it's right or wrong.</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;sstream&gt;
#include &lt;string&gt;

using namespace std;

class Question
{
public:
       Question();

       void set_text(string question_text);
       void set_answer(string correct_response);
       bool check_answer(string response) const;
       void display() const;

private:
        string text;
        string answer;
};

Question::Question()
{
}    

void Question::set_text(string question_text)
{
     text = question_text;
}

void Question::set_answer(string correct_response)
{
     answer = correct_response;
}

bool Question::check_answer(string response) const
{
     return response == answer;    
}

void Question::display() const
{
     cout &lt;&lt; text &lt;&lt; endl;
}

int main()
{
    string response;
    cout &lt;&lt; boolalpha;

    Question q1;
    q1.set_text("Who was the inventor of  C ++ ? " );
    q1.set_answer("Bjarne Stroustrup" );

    q1.display();
    cout &lt;&lt; " Your answer is :  " ;
    getline(cin,response);
    cout &lt;&lt; q1.check_answer(response) &lt;&lt; endl;
    return 0;
}
</code></pre>

<p>Problem is it requires also for me to add a class for NumericalQuestion that checks if there's more than  0.01 difference between response and expected answer. And this is where I'm getting my difficulties.
If someone can show me how it can be done or give me some tips I'll be really grateful.</p>
