Advertisement
zCool

Question.cpp

May 23rd, 2012
21
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement