// the ourAnimals array will store the following: string animalSpecies = ""; string animalID = ""; string animalAge = ""; string animalPhysicalDescription = ""; string animalPersonalityDescription = ""; string animalNickname = "";
// variables that support data entry int maxPets = 8; string? readResult; string menuSelection = "";
// array used to store runtime data, there is no persisted data string[,] ourAnimals = newstring[maxPets, 6];
為 switch 陳述式保留條件撰寫的位置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
switch (menuSelection) { case"1": // List all of our current pet information Console.WriteLine("this app feature is coming soon - please check back to see progress."); Console.WriteLine("Press the Enter key to continue."); readResult = Console.ReadLine(); break;
case"2": // List all of our current pet information Console.WriteLine("this app feature is coming soon - please check back to see progress."); Console.WriteLine("Press the Enter key to continue."); readResult = Console.ReadLine(); break;