Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.21 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include "Question.h"
  4. #include <string>
  5. using namespace std;
  6.  
  7.  
  8. // default constructor
  9. Question::Question(string question, string ans1, string ans2, string ans3, string ans4, unsigned short int correct) {
  10.    
  11.     question = this->question;
  12.     ans1 = answer1;
  13.     ans2 = answer2;
  14.     ans3 = answer3;
  15.     ans4 = answer4;
  16.     correct = correctAnswer;
  17.  
  18. }
  19.  
  20. // setters, access functions and set private members
  21. void Question::setQuestion(string question) {
  22.     this->question = question;
  23. }
  24. void Question::setAnswer1(string ans) {
  25.     answer1 = ans;
  26. }
  27.  
  28. void Question::setAnswer2(string ans) {
  29.     answer2 = ans;
  30. }
  31.  
  32. void Question::setAnswer3(string ans) {
  33.     answer3 = ans;
  34. }
  35.  
  36. void Question::setAnswer4(string ans) {
  37.     answer4 = ans;
  38. }
  39.  
  40. void Question::setCorrect(unsigned short int correct) {
  41.     correctAnswer = correct;
  42. }
  43.  
  44. // getters
  45. string Question::getQuestion() {
  46.     return question;
  47. }
  48.  
  49. string Question::getAnswer1() {
  50.     return answer1;;
  51. }
  52.  
  53. string Question::getAnswer2() {
  54.     return answer2;
  55. }
  56.  
  57. string Question::getAnswer3() {
  58.     return answer3;
  59. }
  60.  
  61. string Question::getAnswer4() {
  62.     return answer4;
  63. }
  64.  
  65. unsigned short int Question::getCorrectAnswer() {
  66.     return correctAnswer;
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement