Hello I am trying to write a program that prompts the user for 3 test scores, averages the 3 test scores, and keeps repeating until the user enters "N". My problem is that I am creating the average and exam scores as data type double but in order to check for "N" I am not sure what data type I should be using or if I should be converting. My code is the following:
void compute()
{
char firstExam;
double secondExam, thirdExam,avg;
cout << "Enter the 1st test score (N to end): ";
cin >> firstExam;
while (firstExam != "N")
{
cout << "Enter the 2nd test score: ";
cin >> secondExam;
cout << "Enter the 3rd test score: ";
cin >> thirdExam;
avg = (firstExam + secondExam + thirdExam) / 3
cout << avg << endl;
cout << "Enter the 1st test score (N to end): ";
cin >> firstExam;
}
}