I am trying to write a Program that can Take an upper case and lower case State Aberviation and display the full name. Using a switch. Here is my code
// Jeff Flogerzi
// September 12
// CIS-17A
// HW_CHP4 State Abbreviations
#include <iostream>
using namespace std;
int main()
{
char state[2];
cout << "Please Enter one of the Following State Abbrevations:\n";
cout << "NC, SC, GA, FL, or AL.\n\n";
cin >> state;
switch(state)
{
case 'nc':
case 'NC':
cout << "The corresponsing State for the Abbreviation for NC is North Carolina\n";
break;
case 'SC':
case 'sc':
cout << "The corresponsing State for the Abbreviation for SC is South Carolina\n";
break;
case 'GA':
case 'ga':
cout << "The corresponsing State for the Abbreviation for GA is Georgia\n";
break;
case 'FL':
case 'fl':
cout << "The corresponsing State for the Abbreviation for FL is Florida\n";
break;
case 'AL':
case 'al':
cout << "The corresponsing State for the Abbreviation for AL is Alabama\n";
break;
default:
cout << "Input Error, Please enter NC,SC,GA,FL,AL.\n";
}
return 0;
}
