online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <iostream> #include <iomanip> #include <string> using namespace std; int main(){ cout<< std::fixed << std::setprecision(2); int totalCredits = 0; int gradePoints = 0; string courseName; string grade; string answer = "Yes"; while (answer == "Yes"){ cout<<"Enter a course name: "; getline (cin, courseName); cout<< courseName <<endl; cout<<"Enter number of credits: "; int credits; cin>>credits; cout<<credits <<endl; totalCredits = totalCredits + credits; cout<<"Enter your grade (A, B, C, D, F): "; cin>>grade; cout<<grade <<endl; if (grade == "A"){ gradePoints = gradePoints + (4.00 * credits); } else if (grade == "B"){ gradePoints = gradePoints + (3.00 * credits); } else if (grade == "C"){ gradePoints = gradePoints + (2.00 * credits); } else if (grade == "D"){ gradePoints = gradePoints + (1.00 * credits); } cout<<"Continue ('Yes' or 'No')? "; cin>>answer; cout<<answer <<endl; cin.ignore(99999,'\n'); cin.clear(); } cout<<"Total grade points: " <<gradePoints <<endl; cout<<"Total credits attempted: " <<totalCredits <<endl; float gpa = 0; gpa = (double) gradePoints/totalCredits; cout<<"Your GPA is " <<gpa <<endl; return 0; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue