Sunday, June 8, 2014

C++ Beginners Tutorial 7 - Switch Statement



#include <iostream>
using namespace std;
int main()
{
    char grade;
    cout<<"Please Enter the grade"<<endl;
    cin>>grade;

    switch(grade)
    {
       case 'a':
       case 'A' : cout<<"Excellent"<<endl;
       break;
        case 'B' : cout<<"Very Good"<<endl;
       break;
        case 'C' : cout<<"You Passed"<<endl;
       break;
        default:
            cout<<"Invalid Entry"<<endl;
       break;

    }
    return 0;
}

Partner Sites

VideoToGifs.com

EasyOnlineConverter.com

SqliteTutorials.com


Stuff I use to make videos

Windows notebook - http://amzn.to/2ADOPrW

Apple MacBook Pro - http://amzn.to/2AC0WG2

Microphone - http://amzn.to/2AC1kV0

notebook mouse - http://amzn.to/2BmeZ2d