34,333
edits
Changes
→Using the C# goto and continue statements
<pre>
using System;
using System.Text;
class Hello
{
static void Main()
{
string carModel;
string carManufacturer;
string messageString;
System.Console.Write ("Please Enter Your Vehicle Model: ");
carModel = System.Console.ReadLine();
switch (carModel)
{
case "Patriot":
case "Liberty":
case "Wrangler":
carManufacturer = "Jeep";
goto default;
case "Focus":
carManufacturer = "Ford";
goto default;
case "Corolla":
carManufacturer = "Toyota";
goto default;
default:
System.Console.WriteLine ("The " + carModel + " is manufactured by " + carManufacturer);
break;
}
}
}
</pre>