static void Main(string[] args) { Lion Lion1 = new Lion("Pesho", 6); Lion Lion2 = new Lion("Nikola", 2); Bear Bear1 = new Bear("Lili", 4); Bear Bear2 = new Bear("Stefi", 3); /* * Lion1.Eat(6); * Lion2.Eat(4); * Bear1.Eat(2); * Bear2.Eat(3); */ zookeeper zookeeper1 = new zookeeper("Ivan"); List <Animal> animals = new List <Animal>(); { animals.Add(Lion1); animals.Add(Lion2); animals.Add(Bear1); animals.Add(Bear2); }; zookeeper.FeedAnimals(animals); }
public static void Main(string[] args) { Bear bear = new Bear("Bear"); string ad = bear.Name; Console.WriteLine(ad); }
static void Main(string[] args) { Bear bear = new Bear("Ivan"); Gorilla gorilla = new Gorilla("Maxwell"); Lizard lizard = new Lizard("Alexey"); Snake snake = new Snake("Mariah"); }
public static void Main(string[] args) { string name = Console.ReadLine(); Bear bear = new Bear(name); Console.WriteLine(bear.ToString()); }
public static void Main(string[] args) { Animal animal = new Reptile("Lizzrd"); Animal mammal = new Mammal("bear"); mammal = new Bear("bear"); Console.WriteLine(mammal); }
private static void WelcomeToTheZoo() { Console.WriteLine("Welcome to my zoo!"); Console.Write("We have a Lion that:"); Lion lion = new Lion(); Console.WriteLine(lion.Scratch()); Console.Write("We have a Tiger that:"); Tiger tiger = new Tiger(); Console.WriteLine(tiger.Hunt()); Console.Write("We have a Bear that:"); Bear bear = new Bear(); Console.WriteLine(bear.Sleep()); Console.Write("We have a Crocodile that:"); Crocodile crocodile = new Crocodile(); Console.WriteLine(crocodile.Move()); Console.Write("And a Velociraptor that:"); Velociraptor velociraptor = new Velociraptor(); Console.WriteLine(velociraptor.Move()); Console.WriteLine("This is probably the best zoo ever"); }
static void Main(string[] args) { Console.WriteLine("Welcome to Deziree's Animal Kingdom!"); Tiger tiger = new Tiger(); Console.WriteLine(">>>>TIGER<<<<"); Console.WriteLine(tiger.Eat()); Console.WriteLine($"I say: '{tiger.Sound()}'"); Console.WriteLine($"I have {tiger.Legs} legs."); Bear bear = new Bear(); Console.WriteLine(">>>>BEAR<<<<<"); Console.WriteLine(bear.Eat()); Console.WriteLine($"I say: '{bear.Sound()}'"); Console.WriteLine($"I have {bear.Legs} legs."); Orangutan orangutan = new Orangutan(); Console.WriteLine(">>>>ORANGUTAN<<<<"); Console.WriteLine(orangutan.Eat()); Console.WriteLine($"I say: '{orangutan.Sound()}'"); Owl owl = new Owl(); Console.WriteLine(">>>>OWL<<<<"); Console.WriteLine(owl.Eat()); Console.WriteLine($"I say: '{owl.Sound()}'"); Console.WriteLine($"I have {owl.Legs} legs."); GoldFish goldfish = new GoldFish(); Console.WriteLine(">>>>GOLD FISH<<<<"); Console.WriteLine(goldfish.Eat()); Console.WriteLine($"I say: '{goldfish.Sound()}'"); }
public static void Main(string[] args) { Animal bear = new Bear("Bear"); Reptile snake = new Snake("Snake"); }
static void Main() { Animal animal = new Bear("Yoggy"); }
static void Main(string[] args) { var mecho = new Bear("Puh"); Console.WriteLine(mecho.Name); }
static void Main(string[] args) { // make animals Skunk skunk = new Skunk(); Weasel weasel = new Weasel(); Bear bear = new Bear(); Lion lion = new Lion(); Wolf wolf = new Wolf(); Narwhal narwhal = new Narwhal(); Dolphin dolphin = new Dolphin(); Orca orca = new Orca(); // make dinner IAmDinner rat = new OtherEdibleCritters(); IAmDinner mole = new OtherEdibleCritters(); IAmDinner guppy = new OtherEdibleCritters(); IAmDinner salmon = new OtherEdibleCritters(); IAmDinner tuna = new OtherEdibleCritters(); IAmDinner sturgeon = new OtherEdibleCritters(); IAmDinner bass = new OtherEdibleCritters(); // setting the stage Console.WriteLine("Chaos at the zoo! All of the enclosures have been torn down by angry environmentalists, and the animals are out of control!"); // skunk eats mole and births 3 babies Console.WriteLine(""); skunk.Eat(mole); skunk.GiveBirth(3); // weasel eats rat and births 6 babies Console.WriteLine(""); weasel.Eat(rat); weasel.GiveBirth(6); // lion and wolf each feast at the newly stocked weasel buffet Console.WriteLine(""); lion.Eat(weasel); wolf.Eat(weasel); // wolf is expecting, so she also eats a bass Console.WriteLine(""); wolf.Eat(bass); wolf.GiveBirth(3); // lion also had some buns in the oven Console.WriteLine(""); lion.GiveBirth(4); // bear went out for dinner, and then went home to have babies and a nap Console.WriteLine(""); bear.Travel(); bear.Eat(salmon); bear.Travel(); bear.GiveBirth(1); // meanwhile, in the water, everyone had babies! Console.WriteLine(""); narwhal.GiveBirth(1); orca.GiveBirth(1); dolphin.GiveBirth(1); // ...and got hungry Console.WriteLine(""); narwhal.Eat(guppy); dolphin.Eat(sturgeon); orca.Eat(narwhal); orca.Eat(dolphin); Console.ReadLine(); }