Esempio n. 1
0
        static void Main(string[] args)
        {
            Pet pet1 = new Pet("dog", "Shadow", "Jose", 42.6);

            Console.WriteLine("Name: " + pet1.name);
            Console.WriteLine("Weight: " + pet1.weight);
            Console.WriteLine(pet1.getTag());

            Console.WriteLine("");

            Dog dog1 = new Dog("Daisy", "Kent", 23.4);

            Console.WriteLine("Name: " + dog1.name);
            Console.WriteLine("Weight: " + dog1.weight);
            Console.WriteLine(dog1.getTag());
            Console.WriteLine(dog1.bark(4));

            Console.WriteLine("");

            Cat cat1 = new Cat("Simba", "Maria", 5.2);

            Console.WriteLine("Name: " + cat1.name);
            Console.WriteLine("Weight: " + cat1.weight);
            Console.WriteLine(cat1.getTag());
            Console.WriteLine(cat1.meow(3));

            Console.ReadKey();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            // For the Pet class
            Pet pet1 = new Pet("dog", "Shadow", "Jose", 42.6);

            Console.WriteLine("Name: " + pet1.name);
            Console.WriteLine("Weight: " + pet1.weight);
            Console.WriteLine(pet1.getTag());

            Console.WriteLine("");

            //For the Dog class
            Dog dog1 = new Dog("Daisy", "Kent", 23.4);

            Console.WriteLine("Name: " + dog1.name);
            Console.WriteLine("Weight: " + dog1.weight);
            Console.WriteLine(dog1.getTag());
            Console.WriteLine(dog1.bark(4));

            Console.WriteLine("");

            //For the Cat class
            Cat cat1 = new Cat("Simba", "Maria", 5.2);

            Console.WriteLine("Name: " + cat1.name);
            Console.WriteLine("Weight: " + cat1.weight);
            Console.WriteLine(cat1.getTag());
            Console.WriteLine(cat1.meow(3));

            Console.WriteLine("");

            Console.Write("Press any key to continue...");

            Console.ReadLine();
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            Pet newPet = new Pet("Dog", "Test pet", "George", 41.4);

            Console.WriteLine("Name: " + newPet.name);
            Console.WriteLine("Weight: " + newPet.weight + " lbs");
            Console.WriteLine(newPet.getTag());

            Dog newDog = new Dog("Pupper", "Jimmy", 21.2);

            Console.WriteLine("\nName: " + newDog.name);
            Console.WriteLine("Weight: " + newDog.weight + " lbs");
            Console.WriteLine(newDog.getTag());
            Console.WriteLine(newDog.bark(4));

            Cat newCat = new Cat("Kitty", "John", 10.8);

            Console.WriteLine("\nName: " + newCat.name);
            Console.WriteLine("Weight: " + newCat.weight + " lbs");
            Console.WriteLine(newCat.getTag());
            Console.WriteLine(newCat.meow(2));

            Console.WriteLine("\nPress any key to continue...");
            Console.ReadLine();
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            Cat cat1 = new Cat("Simba", "Maria", 5.2);

            Console.WriteLine("Name: " + cat1.name);
            Console.WriteLine("Weight: " + cat1.weight);
            Console.WriteLine(cat1.getTag());
            Console.WriteLine(cat1.meow(3));
        }