﻿abstract class Animal
{
    // Attributes
    private _name: string;

    // Constructor
    constructor(name: string)
    {
        this._name = name;
    }

    // Properties
    get Name(): string
    {
        return this._name;
    }

    // Methods
    Move(metres: number): string
    {
        return this._name + " moved " + metres + "m";
    }

    // Code for this method MUST be provided by the child class
    abstract MakeNoise(): string;
} 

class Horse extends Animal
{
    // Attributes

    // Constructor
    constructor(name: string)
    {
        super(name);
    }

    // Properties

    // Methods

    // Override the parent class method
    Move(metres: number): string
    {
        return "Galloping..." + super.Move(metres); // Call parent class method using "super"
    }

    // Must override the abstract parent method
    MakeNoise(): string
    {
        return "Heeeeee";
    }
}

class Snake extends Animal
{
    // Attributes

    // Constructor
    constructor(name: string)
    {
        super(name);
    }

    // Properties

    // Methods

    // Override the parent class method
    Move(metres: number): string
    {
        return "Slithering..." + super.Move(metres); // Call parent class method using "super"
    }

    // Must override the abstract parent method
    MakeNoise(): string
    {
        return "Sssssss";
    }
}

