public static void SelectingOptions(int option) { AddressCheck address = new AddressCheck(); switch (option) { case 1: address.AddToAddressBook(); break; case 2: address.EditDetails(); break; case 3: address.DeleteDetails(); break; case 4: address.ExistingAddressBook(); break; default: Console.WriteLine("Enter valid options"); ChooseOptions(); break; } }
///Defining a method to facilitate choosing an option for the user public static void SelectingOptions(int option) { switch (option) { case 1: AddressCheck.AddToAddressBook(); break; case 2: AddressCheck.EditDetails(); break; case 3: AddressCheck.DeleteDetails(); break; case 4: AddressCheck.GetAddressBook(); break; case 5: AddressCheck.SearchByCity(); break; case 6: AddressCheck.SearchByState(); break; case 7: AddressCheck.CountPeopleFromCityAndState(); break; case 8: AddressCheck.OrderByName(); break; case 9: AddressCheck.OrderByCityStateZip(); break; default: Console.WriteLine("Enter valid options"); ChooseOptions(); break; } }