I need help I have the same issue but im getting an error
The local Driver's License Office has asked you to write a program that grades the written
portion of the driver's license exam.
The exam has 20 multiple choice questions.
Here are the
correct answers:
1. B
6. A
11. B
16. C
2. D
7. B
12. C
17. C
3. A
8. A
13. D
18. D
4. A
9. C
14. A
19. D
5. C
10. D
15. D
20. A
Your program should store the correct answers shown above in an array.
It
should ask the user
to enter the student's answers for each of the 20 questions, and the answers should be stored in
another array.
After the student's answers have been entered, the program should display a list
showing the question numbers of the incorr
ectly answered questions, the total number of
correctly answered questions, and the total number of incorrectly answered questions. It should
then display a message indicating whether the student passed or failed the exam. (A student must
correctly answer
15 of the 20 questions to pass the exam.)
Create a function named
inputAnswers
to obtain the 20 answers from the user.
Create another function called
checkAnswers
to compare the user's answers to the correct
answers.
The function should display a list s
howing the question numbers of the
inncorrectly
answered questions and return the number of correct answers.
Create 1 more function called
displayResult
that takes the number of correct answers as a
parameter and determines if the user passed and displays
the total number of correctly answered
questions and the total number of incorrectly answered questions
This is what i have so far,
#include
#include
#include
#include
#include
#include
#include
using namespace std;
void inputAnswers();
void checkAnswers();
void displayResults();
int point1, point2, point3, point4, point5, point6, point7, point8, point9, point10, point11, point12,
point13, point14, point15, point16, point17, point18, point19, point20;
int c_answer, i_answer;
const int i_answers = 20;
int A, B, C, D;
int sum = (point1 + point2 + point3 + point4 + point5 + point6 + point7 + point8 + point9 + point10 + point11 + point12 +
point13 + point14 + point15 + point16 + point17 + point18 + point19 + point20);
int main()
{
//***************************************************************************************************************
// function calls
//***************************************************************************************************************
inputAnswers();
checkAnswers();
displayResults();
return 0;
}
//***************************************************************************************************************
// Return Type list - inputAnswers ( [20] )
//***************************************************************************************************************
void inputAnswers(int i_answer[20]) // Collects answers from student
{
const int i_answers = 20;
int count;
for (count = 0; count < 20; count++)
while (!((i_answers == 'a') || (i_answers == 'A')
|| (i_answers == 'b') || (i_answers == 'B')
|| (i_answers == 'c') || (i_answers == 'C')
|| (i_answers == 'd') || (i_answers == 'D')))
cout << "invalid" << endl;
cout << "Applicant, please enter your /n";
cout << i_answer << "answers." << endl;
cin >> i_answer[0];
cin >> i_answer[1];
cin >> i_answer[2];
cin >> i_answer[3];
cin >> i_answer[4];
cin >> i_answer[5];
cin >> i_answer[6];
cin >> i_answer[7];
cin >> i_answer[8];
cin >> i_answer[9];
cin >> i_answer[10];
cin >> i_answer[11];
cin >> i_answer[12];
cin >> i_answer[13];
cin >> i_answer[14];
cin >> i_answer[15];
cin >> i_answer[16];
cin >> i_answer[17];
cin >> i_answer[18];
cin >> i_answer[19];
return;
}
//***************************************************************************************************************
// Return Type checkAnswers ( [20] )
//***************************************************************************************************************
void checkAnswers() // Compares student's answers to the correct answers,
//displays wrong answers, and totals correct answers
{
int c_answer[20] = { 'B', 'D', 'A', 'A', 'C', 'A', 'B', 'A', 'C', 'D',
'B', 'C', 'D', 'A', 'D', 'C', 'C', 'D', 'D', 'A' };
int *i_answer;
if (i_answer[0] = c_answer[0])
point1 = 1;
else cout << "1. Incorrect" << endl;
point1 = 0;
if (i_answer[1] = c_answer[1])
point2 = 1;
else cout << "2. Incorrect" << endl;
point2 = 0;
if (i_answer[2] = c_answer[2])
point3 = 1;
else cout << "3. Incorrect" << endl;
point3 = 0;
if (i_answer[3] = c_answer[3])
point4 = 1;
else cout << "4. Incorrect" << endl;
point4 = 0;
if (i_answer[4] = c_answer[4])
point5 = 1;
else cout << "5. Incorrect" << endl;
point5 = 0;
if (i_answer[5] = c_answer[5])
point6 = 1;
else cout << "6. Incorrect" << endl;
point6 = 0;
if (i_answer[6] = c_answer[6])
point7 = 1;
else cout << "7. Incorrect" << endl;
point7 = 0;
if (i_answer[7] = c_answer[7])
point8 = 1;
else cout << "8. Incorrect" << endl;
point8 = 0;
if (i_answer[8] = c_answer[8])
point9 = 1;
else cout << "9. Incorrect" << endl;
point9 = 0;
if (i_answer[9] = c_answer[9])
point10 = 1;
else cout << "10. Incorrect" << endl;
point10 = 0;
if (i_answer[10] = c_answer[10])
point11 = 1;
else cout << "11. Incorrect" << endl;
point11 = 0;
if (i_answer[11] = c_answer[11])
point12 = 1;
else cout << "12. Incorrect" << endl;
point12 = 0;
if (i_answer[12] = c_answer[12])
point13 = 1;
else cout << "13. Incorrect" << endl;
point13 = 0;
if (i_answer[13] = c_answer[13])
point14 = 1;
else cout << "14. Incorrect" << endl;
point14 = 0;
if (i_answer[14] = c_answer[14])
point15 = 1;
else cout << "15. Incorrect" << endl;
point15 = 0;
if (i_answer[15] = c_answer[15])
point16 = 1;
else cout << "16. Incorrect" << endl;
point16 = 0;
if (i_answer[16] = c_answer[16])
point17 = 1;
else cout << "17. Incorrect" << endl;
point17 = 0;
if (i_answer[17] = c_answer[17])
point18 = 1;
else cout << "18. Incorrect" << endl;
point18 = 0;
if (i_answer[18] = c_answer[18])
point19 = 1;
else cout << "19. Incorrect" << endl;
point19 = 0;
if (i_answer[19] = c_answer[19])
point20 = 1;
else cout << "20. Incorrect" << endl;
point20 = 0;
return;
}
//***************************************************************************************************************
// Return Type product - displayResults ()
//***************************************************************************************************************
void displayResults() // determines whether the student passed the test
{
int Results = (sum / 20) * 100;
cout << sum << " correct answers" << endl;
cout << Results << "%" << endl;
if (sum >= 15)
cout << "You Passed!!!!!" << endl;
else
cout << "Try Again" << endl;
}
the error
Error 1 error C2660: 'inputAnswers' : function does not take 1 arguments c:\users\kocha3\documents\visual studio 2013\projects\cop2001\consoleapplication1\program6_7.cpp 36 1 ConsoleApplication1