Code:
switch(paycode){
case 1: //calculate pay
break;
case 2: //calculate pay
break;
default: std::cout << "you entered an in correct pay type";
break;
} The switch will execute any code between the case 1: and the break; statements.
This may have changed but yeah it used to be implemented as a series of if/else statements. Java does it as a jump table but they may have changed the way the compilier works. in any case its a cleaner neater looking way of doing instead of if else statements.