public static void Main() { //Creating the objects of the classes Program c = new Program(); BMI b = new BMI(); Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine("==============\n Calculator \n============== "); Console.ResetColor(); Console.ForegroundColor = ConsoleColor.Cyan; Console.WriteLine("Please select what calculator you want to use" + "\n1. Normal Calculator\n2. BMI Calculator"); START :; string yas = Console.ReadLine(); switch (yas) { case "1": c.switchStatement(); break; case "2": b.Bmi(); break; default: Console.WriteLine("Argument out of range, please retry"); goto START; } }
public static void Main() { //Creating the objects of the classes Program c = new Program(); BMI b = new BMI(); Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine("==============\n Calculator \n============== "); Console.ResetColor(); Console.ForegroundColor = ConsoleColor.Cyan; Console.WriteLine("Please select what calculator you want to use" + "\n1. Normal Calculator\n2. BMI Calculator"); string yas = Console.ReadLine(); if (yas == "1") { c.switchStatement(); } else if (yas == "2") { b.Bmi(); } Console.WriteLine(c.used); }