hello i am supposed to design a code to convert state abbreviations from only five states. I don't really know how to put if...else statement in here if anyone can help. This is what I have written so far but i am beginning so it could be completely wrong.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace week0701
{
class Program
{
static void Main(string[] args)
{
string option;
string NC;
string AL;
string GA;
string FL;
string OH;
Console.WriteLine("Please enter one of the following state abbreviations");
Console.WriteLine("NC, AL, GA, FL, or OH: ");
Console.ReadLine();
switch (option.ToLower())
{ // create switches for lower cases
case "nc":
toNC();
break;
case "al":
toAL();
break;
case "ga":
toGA;
break;
case "fl":
toFL;
break;
case "oh":
toOH;
break;
}
}
static void toNC()
{
// assign variables
string state = "North Carolina";
Console.WriteLine("NC is {0}", state);
}
static void toAL()
{
// al to alabama
string state = "Alabama";
Console.WriteLine("AL is {0}", state);
}
static void toGA()
{
// ga to georgia
string state = "Georgia";
Console.WriteLine("GA is {0}", state);
}
static void toFL()
{
// fl to florida
string state = "Florida";
Console.WriteLine("FL is {0}", state);
}
static void toOH()
{
// oh to ohio
string state = "Ohio";
Console.WriteLine("OH is {0}", state);
}
}
}