Example #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();
        }
Example #2
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();
        }
Example #3
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();
        }
Example #4
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.ReadLine();
        }
Example #5
0
        static void Main(string[] args)
        {
            // The code provided will print ‘Hello World’ to the console.
            // Press Ctrl+F5 (or go to Debug > Start Without Debugging) to run your app.

            Pet pet1 = new Pet("dog", "Shadow", "Jose", 42.6);

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

            // Go to http://aka.ms/dotnet-get-started-console to continue learning how to build a console app!
        }
Example #6
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() + "\n");

            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) + "\n");

            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(4) + "\n");
            Console.WriteLine("End of program\nPress any key to close");
            Console.ReadKey();
        }