hello-
total c++ n00b here and i'm having problems with an assignment where we're supposed to compare an array of exam answers to an array containg a predetermined answer key and then indicate whether the exam taker has passed or failed. my program compiles just fine, but i'm not getting any output when the program runs. i'm working in visual studio 2010 and have created a win32 console application for my project. when the program runs, the console window pops up but only displays a blinking cursor and nothing else. please see the following code and attached screenshot, thanks in advance!
#include "TestGrader.h"
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
void TestGrader::setKey(char key[])
{
for(int i = 0; i < NUM_QUESTIONS; i++)
{
char key[] = {"BDAACABACDBCDADCCBDA"};
}
}
void TestGrader::grade(char answers[20])
{
int num_correct = 0;
int num_incorrect = 0;
int questions_wrong[NUM_QUESTIONS] = {0};
for(int i = 0; i < NUM_QUESTIONS; i++)
{
if(!( questions_wrong[NUM_QUESTIONS] == answers[20]))
{
num_incorrect++;
}
else
{
num_correct++;
}
}
if(num_correct >= 15)
cout << "Applicant Passed" << endl;
else
{
cout << "Applicant Failed" << endl;
}
cout << "Correct" << num_correct << endl;
cout << "Incorrect" << num_incorrect << endl;
}