public static void Main(string[] args) { Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine("BNU CO453 Applications Programming 2020-2021!"); Console.WriteLine(); Console.Beep(); string [] choices = { " Distance Converter", " BMI Calculator", " Student Grades", " Social Network", " RPG Game" }; int choice = ConsoleHelper.SelectChoice(choices); if (choice == 1) { DistanceConverter converter = new DistanceConverter(); converter.Run(); } else if (choice == 2) { BMI calculator = new App02.BMI(); calculator.Run(); } else if (choice == 3) { StudentMarks grader = new StudentMarks(); grader.Run(); } else if (choice == 4) { SocialNetworkMain social = new SocialNetworkMain(); social.Run(); } }
public static void Main(string[] args) { Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine("BNU CO453 Applications Programming!"); Console.WriteLine("1: Distance converter"); Console.WriteLine("2: BMI Calculator"); Console.WriteLine("3: StudentMarks"); Console.WriteLine("4: Social Network"); Console.WriteLine("Please choose your desired Program > "); string choice = Console.ReadLine(); if (choice == "1") { DistanceConverter converter = new DistanceConverter(); converter.Run(); } else if (choice == "2") { App02.BMI converter = new App02.BMI(); converter.run(); } else if (choice == "3") { App04.DisplayMenu(); } }
/** * The value gained from userinput in chooseSystem is applied to perform choice * in order to determine whether 1 or 2 has been chosen and applies the metric * or imperial methods. */ private static string performChoice(string choice) { if (choice.Equals("1")) { return(FEET_AND_STONE); } else if (choice.Equals("2")) { return(METRES_AND_KILOGRAMS); } else { Console.WriteLine("\nYou have entered an invalid value."); BMI restartBMI = new BMI(); restartBMI.BMICalculator(); return(null); } }