In: Computer Science
You and your team of software developers are creating a game for children. The game has different types of animals.
As a team of software developers, create in a 1-page Word document the class "Animal," including appropriate methods and properties that are common to all animals, subclasses of Animal, such as Cats, Dogs, and Birds, and appropriate methods and properties unique to these subclasses.
abstract class Animal {
float height;
float weight;
float energy;
string breed;
public Eat() {
energy++;
weight++;
}
public Attack() {
energy--;
weight--;
}
public void Greet() {
Console.WriteLine("Hello");
}
public void Talk() {
Console.WriteLine("Talking");
}
public virtual void Sing() {
Console.WriteLine("Singing");
}
}
class Cat: Animal {
int somethingSpecificToCat;
public Cat() {
//your constructor. initialize all fields
}
}
class Dog: Animal {
int somethingSpecificToDog;
public Dog() {
//your constructor. initialize all fields
}
}
class Birds: Animal {
int somethingSpecificToBirds;
public Birds() {
//your constructor. initialize all fields
}
}