Why does program terminate?

Writing a program to calculate grades...
My algorithm is long, so I only posted the part that gives me trouble.
When classes== 1,2,4, or 5, the program runs fine. but it terminates when classes == 3.
Please help !

if (classes==3) {
do {
cout<<"Enter the Letter grade for 1st class. (USE CAPS)"<<endl;
cin>>grade1;

} while (!(grade1=='A' || grade1=='B' || grade1=='C' || grade1=='D' || grade1=='F' || grade1=='W' || grade1=='P'));

do {
cout<<"Enter the Letter grade for 2nd class. (USE CAPS)"<<endl;
cin>>grade2;

} while (!(grade2=='A' || grade2=='B' || grade2=='C' || grade2=='D' || grade2=='F' || grade2=='W' || grade2=='P'));

do {
cout<<"Enter the Letter grade for 3rd class. (USE CAPS)"<<endl;
cin>>grade3;

} while (!(grade3=='A' || grade3=='B' || grade3=='C' || grade3=='D' || grade3=='F' || grade3=='W' || grade3=='P'));



cout<<"Enter credit hour for course 1 (example 3.5)"<<endl;
cin>> CR1;
cout<<"Enter credit hour for course 2"<<endl;
cin>> CR2;
cout<<"Enter credit hour for course 3"<<endl;
cin>>CR3;

"terminates" meaning run time error? crash? exception?
Post more details about it
Can you screenshot the error message? It is not clear what your question is? Your code looks fine, but what numbers are you entering after you build it? It may be a problem with the data type(float, int, double, ect.)
I don't know if it's just how the code was pasted into the forum, but I don't see a closing } for the if (classes==3) {
Topic archived. No new replies allowed.