I am trying to create a quiz in C++ and here is what i have came up with so far:
I am getting errors when calling the usersScore and usersInput functions
Can someone give me some guidance please.
#include <iostream>
using namespace std;
class Question
{
public:
string question;
string possAnswers;
int marks;
string comment;
int usersAnswer;
int inputAnswer;
int usersScore;
void displayQuestion()
{
cout << endl;
cout << "Question 1" << endl;
cout << "How do you declare a variable x to be a pointer to a constant interger?" << endl;
cout << "1) int * const x" << endl;
cout << "2) int const * const x" << endl;
cout << "3) int const *x" << endl;
cout << "4) int *x" <<endl;
cout << "Please press a number to correspond your answer:" << endl;
}//displayQuestion
void correctAnswer(int usersInput, int usersScore)
{
if(usersInput ==1)
{
usersScore+2;
}
}//correctAnswer
};
void getUsersAnswer(int usersInput)
{
cin >> usersInput;
}//getUsersAnswer
int main()
{
cout << "Welcome to my Quiz on C++. Please press 1-4 to answer each question.";
cout <<endl;
//creating question object
Question q;
//calling displayQuestion function
q.displayQuestion();
//method to get users input
getUsersAnswer(usersInput);
// setting usersScore to zero
q.usersScore=0;
// calling usersScore function
q.correctAnswer(usersInput, usersScore);
system ("pause");
return 0;
}
I am getting errors when calling the usersScore and usersInput functions

Can someone give me some guidance please.