static void Main(string[] args) { Animals animals = new Animals(); Cats cat1 = new Cats(); cat1.Name = "Wilbur"; animals.Add(cat1); animals.AllCats(); while (true) { Console.WriteLine("Enter exit to quit program or remove to remove a cat."); Console.Write("Enter new cat's name: "); Cats cat2 = new Cats(); string input = Console.ReadLine(); if (input.ToLower() == "exit") { Console.WriteLine("Bye Bye!"); break; } else if (input.ToLower() == "remove") { Console.Write("Enter name of cat you want to remove: "); string removeName = Console.ReadLine(); animals.Remove(removeName); animals.AllCats(); } else { cat2.Name = input; animals.Add(cat2); Console.WriteLine("Printing all cats..."); animals.AllCats(); } } Console.Read(); }
static void Main(string[] args) { Animals animals = new Animals(); Cats cat1 = new Cats(); cat1.Name = "Wilbur"; animals.Add(cat1); animals.AllCats(); while(true) { Console.WriteLine("Enter exit to quit program or remove to remove a cat."); Console.Write("Enter new cat's name: "); Cats cat2 = new Cats(); string input = Console.ReadLine(); if (input.ToLower() == "exit") { Console.WriteLine("Bye Bye!"); break; } else if (input.ToLower() == "remove") { Console.Write("Enter name of cat you want to remove: "); string removeName = Console.ReadLine(); animals.Remove(removeName); animals.AllCats(); } else { cat2.Name = input; animals.Add(cat2); Console.WriteLine("Printing all cats..."); animals.AllCats(); } } Console.Read(); }