my program is supposed to produced a multiple choice test. it works for the first four questions but then it crashes after that. it also produces a warning that the prototyped function not called (was a variable definition intended?)Can someone please explain why it is crashing after 4 questions. i think it has to do with my repeats function but i don't know how to fix it
//Julia Rider and Bryant Goodenough
//Assignment #5
//This program generates a multiple choice quiz using arrays, functions and random numbers
cout << endl << "Enter your answer (a,b,c,d): " << endl; //asking for user input
cin >> response [i];
while ( response [i] != "a" && response [i] != "b" && response [i] != "c" && response [i] != "d" )
{
cout << endl << "Enter your answer (a,b,c,d): "; //checking to make sure the user correctly answers either a,b,c or d
cin >> response [i];
}
if (response [i] == "a" ) { let [i]= 0;}
if (response [i] == "b" ) { let [i]= 1;}
if (response [i] == "c" ) { let [i]= 2;}
if (response [i] == "d" ) { let [i]= 3;}
if (let [i] == an [i] ) {
l++ ; //if the answer is correct display correct, if not display incorrect
cout << "Correct!" << endl;
}
else
{cout << "Incorrect." << endl;}
cout << endl;
}
//checking to make sure that the answer is not already displayed in the choices
) {
choices [ rand () %4] = terms [rand () %10]; //generating new random term if there are repeats
}
return choices;}