SHARE
TWEET

Question.cpp

zCool May 23rd, 2012 5 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "Question.h"
  2. #include <string>
  3. #include <vector>
  4. #include <iostream>
  5.  
  6. Question::Question(std::string questionText, std::vector<Answer> lstAnswers)
  7. {
  8.         m_questionText = questionText;
  9.         m_lstAnswers = lstAnswers;
  10. }
  11.  
  12. bool Question::isRightAnswer(int answeredNumber)
  13. {
  14.         return m_lstAnswers[answeredNumber].getisCorrectAnswer();
  15. }
  16.  
  17. void Question::displayAnswerOptions()
  18. {              
  19.         std::cout << "Answer Choices\n";
  20.         std::cout << "-------------------\n";
  21.  
  22.         for(std::vector<Answer>::size_type i = 0; i < m_lstAnswers.size(); i++ )
  23.         {
  24.                 std::cout << i << ") " << m_lstAnswers[i].getAnswerText() << std::endl;
  25.         }
  26. }
  27.  
  28. void Question::displayQuestion()
  29. {
  30.         std::cout << m_questionText << std::endl << std::endl;
  31. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top