Comparing Arrays question
Code:
I need help with an assignment, he never went over arrays in our class and we have to do this assignment. We are only allowed to use do, for, while, if, else. Here is the question. I'm using the dev compiler.
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
2. D
3. A
4. A
5. C
6. A
7. B
8. A
9. C
10. D
11. B
12. C
13. D
14. A
15. D
16. C
17. C
18. B
19. D
20. A
Your program should store the answers shown above in an array. It should then ask the user to enter the student's answers for each of the 20 questions, which should be stored in another array. After the student's answers have been entered, the program should display a message indicating whether the student passed or failed the exam. (A student should answer 15 of the 20 questions correctly to pass the exam.) It should then display the total number of correctly answered questions, total number of incorrectly answered questions, and a list showing the question numbers of te incorrectly answered questions.
Input validation: only accept the letter a,b,c or d as answers
this is my program so far, i need help:
#include <iostream>
#include <stdlib.h>
#include<cmath>
#include<iomanip>
using namespace std;
int main()
{
int count, correct;
const int size = 21;
char your_answers[size];
char answers[size] = {'b','d','a','a','c','a','b','a','c','d','b','c','d','a','d','c','c','b','d','a', '\0'};
cout<< " Please enter the students answers. \n" ;
for (count = 0; count<size; count++)
{
cin>> your_answers[count];
}