Complete the code to declare a class Dog that inherits from Animal.
class Dog : [1] { }
The class Dog inherits from Animal using the colon : syntax.
Complete the code to call the base class constructor from the derived class Car.
class Car : Vehicle { public Car() : [1]() { } }
In C#, base() calls the constructor of the base class.
Fix the error in the code to override the Speak method in the derived class Cat.
class Cat : Animal { public override void [1]() { Console.WriteLine("Meow"); } }
The method name must exactly match the base class method name including case, which is Speak.
Fill both blanks to create a derived class Bird that inherits from Animal and overrides the Move method.
class Bird : [1] { public override void [2]() { Console.WriteLine("Flying"); } }
The class Bird inherits from Animal and overrides the Move method.
Fill all three blanks to create a dictionary that maps animal names to their sounds using inheritance concepts.
var sounds = new Dictionary<string, string> {
{ [1], [2] },
{ [3], "Bark" }
};The dictionary maps animal names like "Cat" and "Dog" to their sounds like "Meow" and "Bark".