/*
Learning C#
by Jesse Liberty
Publisher: O'Reilly
ISBN: 0596003765
*/
using System;
publicclass SwitchWithDefaultValues
{
staticvoid Main()
{
constint Democrat = 0;
constint Republican = 1;
constint Progressive = 2;
// hard wire to Republican
int myChoice = 5;
// switch on the value of myChoice
switch (myChoice)
{
case Democrat:
Console.WriteLine("You voted Democratic.\n");
break;
case Republican:
Console.WriteLine("You voted Republican.\n");
break;
case Progressive:
Console.WriteLine("You voted Progressive.\n");
break;
default:
Console.WriteLine("You did not make a valid choice.");
break;
}
Console.WriteLine("Thank you for voting.");
}
}