Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include "Question.h"
- #include <string>
- using namespace std;
- // default constructor
- Question::Question(string question, string ans1, string ans2, string ans3, string ans4, unsigned short int correct) {
- question = this->question;
- ans1 = answer1;
- ans2 = answer2;
- ans3 = answer3;
- ans4 = answer4;
- correct = correctAnswer;
- }
- // setters, access functions and set private members
- void Question::setQuestion(string question) {
- this->question = question;
- }
- void Question::setAnswer1(string ans) {
- answer1 = ans;
- }
- void Question::setAnswer2(string ans) {
- answer2 = ans;
- }
- void Question::setAnswer3(string ans) {
- answer3 = ans;
- }
- void Question::setAnswer4(string ans) {
- answer4 = ans;
- }
- void Question::setCorrect(unsigned short int correct) {
- correctAnswer = correct;
- }
- // getters
- string Question::getQuestion() {
- return question;
- }
- string Question::getAnswer1() {
- return answer1;;
- }
- string Question::getAnswer2() {
- return answer2;
- }
- string Question::getAnswer3() {
- return answer3;
- }
- string Question::getAnswer4() {
- return answer4;
- }
- unsigned short int Question::getCorrectAnswer() {
- return correctAnswer;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement