C++ Programming Code Examples C++ > If Else and Switch Case Code Examples Switch statement program in c++ to calculate grade points gpa Switch statement program in c++ to calculate grade points gpa A simple c++ program which shows using of switch statement in c++ C++ Program which takes input a grade and display Grade Points Average GPA Program takes inputs A,a, B,b, C,c,D,d,F,f other option will be consider as invalid input #include<iostream> using namespace std; int main() { char grade; double gpa=0.0; cout<<"Enter your Grade= "; cin>>grade; switch(grade) { case'A': case'a': gpa=4.0; cout<<"your GPA is "<<gpa; break; case'B': case'b': gpa=3.0; cout<<"your GPA is "<<gpa; break; case'C': case'c': gpa=2.0; cout<<"your GPA is "<<gpa; break; case'D': case'd': gpa=1.0; cout<<"your GPA is "<<gpa; break; case'F': case'f': gpa=0.0; cout<<"your GPA is "<<gpa; break; default: cout<<"invalid grade entered"; break; } return 0; }