public void DoShaping() { shapes c = new shapes(); while (true) { Console.WriteLine("Select Shape: (R)ectangle, (C)ircle, (S)quare, (T)riangle:"); var key = Console.ReadKey(); switch (key.Key) { case ConsoleKey.R: c.Rectangle(); break; case ConsoleKey.C: c.Circle(); break; case ConsoleKey.S: c.Square(); break; case ConsoleKey.T: c.Triangle(); break; } } }
public static void Main(string[] args) { shapes s = new shapes(); s.DoShaping(); Console.Write("Press any key to continue . . . "); Console.ReadKey(true); }