Need a point in the right direction

Hi

I am working on a project for school and a point in the right direction please. I am not here for you to write the rest of the program for me but I am really stuck on this project. It is suppose to average a students grade for three exams, here is what I have so far


#include <iostream>
#include <string>
using namespace std;



int main()
{
string studFirstName, studLastName;
double studExam1, studExam2, studExam3, studScore, studAvg;


cout << "Enter student first name, \n";
cin >> studFirstName;

cout << "Enter student last name, \n";
cin >> studLastName;

cout << "Enter score for exam 1, \n";
cin >> studExam1;

cout << "Enter score for exam 2, \n";
cin >> studExam2;

cout << "Enter score for exam 3, \n";
cin >> studExam3;
studScore = studExam1 + studExam2 + studExam3;
studAvg = studScore / 3;
cout << "Students final grade" << studAvg;

if (studAvg >= 90)
{
cout << "Grade = 'A'";
}

else if (studAvg >= 80)
{
cout << "Grade = 'B'";
}

else if (studAvg >= 70)
{
cout << "Grade ='C'";
}

else if (studAvg >= 60)
{
cout << "Grade ='D'";
}

else
{
cout << "Grade ='F'";
}


cout << "Your grade is " << studAvg << endl;

return 0;
}

When I try and run the program it always stop's once I enter the 3 exam scores and cannot figure where my mistake is. Any help is appreciated. Thanks in advance.
Well, the program works for me. I think you have to take a look at this post: http://cplusplus.com/forum/beginner/1988/ because your program quits before you have read the last part.
Good luck!
use cin.get() before return 0;
That worked! Thank you so much! It was my IDE that was the issue.
Topic archived. No new replies allowed.