c programming project assignment
//
//Question.h
Save your time - order a paper!
Get your paper written from scratch within the tight deadline. Our service is a reliable solution to all your troubles. Place an order on any task and we will take care of it. You won’t have to worry about the quality and deadlines
Order Paper Now//Trivia
//
//Created by Hellen Pacheco on 10/15/18.
//Copyright © 2018 Hellen Pacheco. All rights reserved.
//
#ifndef Question_h
#define Question_h
#include <string>
using namespace std;
class Question {
private:
string question;
string answer1;
string answer2;
string answer3;
string answer4;
unsigned short int correctAnswer;
public:
Question();
Question(string question, string ans1, string ans2, string ans3, string ans4, unsigned short int correct);
void setQuestion(string question);
void setAnswer1(string ans);
void setAnswer2(string ans);
void setAnswer3(string ans);
void setAnswer4(string ans);
void setCorrect(unsigned short int correct);
string getQuestion();
string getAnswer1();
string getAnswer2();
string getAnswer3();
string getAnswer4();
unsigned short int getCorrectAnswer();
};
#endif /* Question_hpp */
Trivia Game
Implement the Question class that will be the base for a Trivia Game. The interface for this class is provided in question.h that you can download from ABOVE THE QUESTION. Implement all member functions in question.cpp, which you will turn in. You don’t have to turn in question.h since I already have it. Please note that it is important that you do not change question.h or I won’t be able to compile your program.
Create a program (in main.cpp, which you will turn in) that implements the trivia game. The program should create an array of 10 Question objects, one for each trivia question. Make up your own trivia questions on the subject or subjects of your choice.
To learn how to create and access arrays of objects, refer to section Arrays of Objects in your textbook (13.12 in 9th edition). There is a great example that you can follow there.
Your game should present the user with the 10 questions in a way that you like. How you will present the questions and in which order is up to you, but make sure to follow these requirements:
- the interface is friendly, not cluttered, with clear directions (ask someone to play your game to see if it is easy to follow)
- the user is informed whether the answer they enter is right or wrong. If wrong, let them know what the correct answer is.
Turn in: question.cpp and main.cpp
Rubric
Lab3 rubric
Criteria | Ratings | Pts | ||
---|---|---|---|---|
This criterion is linked to a Learning OutcomeDocumentationFollows guidelines. |
|
5.0 pts |
||
This criterion is linked to a Learning OutcomeQuestion class implementationImplements all member functions appropriately. |
|
20.0 pts |
||
This criterion is linked to a Learning OutcomeGameThe game is interesting, directions are clear, output is clean, not cluttered. Make sure to inform the user of what is happening at all times. |
|
20.0 pts |
||
This criterion is linked to a Learning OutcomeStructureCode does not look cluttered, is well indented and there are no global variables or goto statements. |
|
5.0 pts |
||
Total Points: 50.0 |