I dont know what they mean by undetermined character constant
#include <iostream.h>
#include <stdlib.h>
class student
{
char st_name[25];
char st_major[25];
int i_test1;
int i_test2;
int i_test3;
int i_average;
char ch_grade;
char ch_option;
public:
void getdata();
void processdata();
void putdata();
};
int main()
{
do{
student.getdata();
student.processdata();
student.putdata();
cout << "\n\nDo you want to continue(Y/N)?
cin.get(ch_option);
cin.get();
}while(student.ch_option != 'N');
}
void student::getdata()
{
cout << "\n\nPlease enter Student's Name: ";
cin.getline(st_name,25);
cout << "\n\nPlease enter Student's Major: ";
cin.getline(st_major,25);
cout << "\n\nPlease enter Test Score 1: ";
cin >> i_test1;
cout << "\n\nPlease enter Test Score 2: ";
cin >> i_test2;
cout << "\n\nPlease enter Test Score 3: ";
cin >> i_test3;
}
void student::processdata()
{
i_average = (i_test1 + i_test2 + i_test3) / 3;
switch(i_average)
{
case 9:
ch_grade = 'A';
break;
case 8:
ch_grade = 'B';
break;
case 7:
ch_grade = 'C';
break;
case 6:
ch_grade = 'D';
break;
default:
ch_grade = 'F';
}
}
void student::putdata()
{
cout << "Student Average";
cout << "\n\n**********************************";
cout << "\n\nStudent Name: " << st_name;
cout << "\nStudent Major: " << st_major;
cout << "\nTest Score 1: " << i_test1;
cout << "\nTest Score 2: " << i_test2;
cout << "\nTest Score 3: " << i_test3;
cout << "\n\nAverage: " << i_average;
cout << "\nGrade: " << ch_grade;
cout << "\n\n\nDo you want to exit(Y/N)? " << ch_option;
}