Hello I'm taking my first C++ class and I have really embarrassing question ( because I'm sure I'm missing something simple but I just can't figure out what): Why won't my output "dead loop" show after the do while loop ends with the user entering enter?
// This program will calculate the GPA of a given student.
#include <iostream>
#include <string> // libraries used in the program
using namespace std;
int main( )
{
//Display title and skip a line
cout << "GPA CALCULATOR" << endl;
cout << endl;
//variables used
string name;
string level;
string department;
//int totalUnits;
//int totalGradePoints;
//Output for student name and accept name as string
cout << "Student name:";
// get the whole line in case the user inputs his/her full name
getline (cin, name);
//Output for student level and accept level as string and skip a line
cout << "Student level:";
cin >> level;
//begin the department department loop
do
{
cout << endl;
cout << "Course department:";
cin >> department;
cout << endl;
cout << " loop" << endl;
}while (department != "");
cout << "dead loop";
return 0;
}