static void Main(string[] args) { Bug One = new Bug("Lang", "Bee", new List <string>() { "Hornet, Wasp" }, new List <string>() { "Ants, Pollen" }); One.PrintInfo(); Console.WriteLine(One.FormalName); Console.WriteLine(One.PredatorList()); Console.WriteLine(One.PreyList()); }
static void Main(string[] args) { var caterpillarPreds = new List <string> { "Birds", "Groundhogs" }; var caterpillarPrey = new List <string> { "Leaves", "Microscopic bois" }; var caterpillar = new Bug("Squirmy", "Caterpillar", caterpillarPreds, caterpillarPrey); Console.WriteLine(caterpillar.FormalName); Console.WriteLine(caterpillar.PreyList()); Console.WriteLine(caterpillar.PredatorList()); Console.WriteLine(caterpillar.Eat("Leaves")); Console.ReadLine(); }
static void Main(string[] args) { List <string> Prey = new List <string>(); Prey.Add("Thing1"); Prey.Add("Thing2"); Prey.Add("Thing3"); List <string> Predator = new List <string>(); Predator.Add("Enemy1"); Predator.Add("Enemy2"); Predator.Add("Enemy3"); Bug bug1 = new Bug("Steven", "Humanoid", Predator, Prey); Console.WriteLine(bug1.PreyList()); Console.WriteLine(bug1.PredatorList()); Console.WriteLine(bug1.Eat("Thing1")); }
static void Main(string[] args) { var preds = new List <string>() { "COVID-19", "Putin", }; var prey = new List <string>() { "Women", "Democrats", "Stupid People" }; var trump = new Bug("Trump", "Stupid", preds, prey); Console.WriteLine($"My bugs name is {trump.Name}."); Console.WriteLine($"The species of my bug, s{trump.Name}, is {trump.Species}."); Console.WriteLine($"This is the list of prey: {trump.PreyList()}."); Console.WriteLine($"This is the list of predators: {trump.PredatorList()}."); }