1. 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;
for (count = 0; count<size; count++)
{

}```

2. You're going to need another loop that loops through the both the your_answers array and the answers array and compares the current element in each. You'll then have to do some work about remembering which answers are correct or incorrect.

Do you have an idea of how that loop might look?

3. One way to do it would be to create a score variable.
Then create another 'for' loop that goes through until the end of the "answers" array.
In each iteration of the for loop ( for(int index=0; index<=size-2; index++) ), create an if statement that checks to see if the 'your_answers[index]' == 'answers[index]', if so then add 1 to the score variable.

After that 'for' loop, check to see if the score is above or equal to 15. If so, the user passed the test, if not, they failed..... I'm itching to write the code for you, but I know I shouldn't.

EDIT: Never mind about the 'score' variable- I now see that you have a variable called 'correct'. Use that instead of the 'score' variable.

4. Code:
```flaug i have to use only do, for, if, else and while, cant use dex or index
and no i have no clue where im goin from here i suck with loops and i keep tryin different things for validation such as

{
correct+= 1;
}

5. write some code for me man
you know you want to

6. Will this work for you?

Code:
```#include <iostream>
#include <string>

using namespace std;

int main()
{

int count, correct = 0;
const int size = 21;
for (count = 0; count<size; count++)
{

}

for (count=0; count<=size-2;count++)
{
correct += 1; //If they got this one right, then add one to 'correct'.
}

if(correct >= 15) //They got 15 right
cout << "You passed the test. Congratulations." << endl;
else
cout << "You're a failure." << endl;

return 0;
}```
EDIT: There were some errors... I updated the code.

7. Code:
```it has a problem at the
{
correct +=1;
}```

8. In some cases, the compiler will exit out of the console as soon as the program ends. You can prevent this by making a blank string variable and asking the user to input data into the variable at the end.

Code:
```#include <iostream>
#include <string>

using namespace std;

int main()
{
string end = " ";

int count, correct = 0;
const int size = 20;
for (count = 0; count<=size-1; count++)
{

}

for (count=0; count<=size-1;count++)
{
correct += 1; //If they got this one right, then add one to 'correct'.
}

if(correct >= 15) //They got 15 right
cout << "You passed the test. Congratulations. (" << correct << " out of 20 correct)" << endl;
else
cout << "You're a failure." << endl;

cin >> end;

return 0;
}```
The 'size' variable should only be 20.

9. What is the error message?

10. Code:
```also i need some way of showing which ones they got wrong
and i need to put in answer vallidation
like so you can only put up an a,b,c, or d answer

i tried

{
}

but it didnt work```

11. C:\Users\TimmyD\Desktop\programs\stuffski.cpp In function `int main()':
23 C:\Users\TimmyD\Desktop\programs\stuffski.cpp `your' undeclared (first use this function)
(Each undeclared identifier is reported only once for each function it appears in.)
23 C:\Users\TimmyD\Desktop\programs\stuffski.cpp expected `)' before "answers"

12. the updated version works, now i jus need help on the a, b, c, d validation and displaying all incorrect answers

13. this is annoyingly complicated i hate nested loops

14. I'm working on it.

15. also, i cant use strings, we werent taught that