using System;
namespace P6_4
{
    public enum Color{noColor,red,orange,yellow,green,cyan,blue,purple} 
    public abstract class Car     			 //˴ǳ
    { 
        private Color col; 
        public Car() 
        { 
            this.col = Color.noColor; 
        }
        public Car(Color c) 
        { 
            this.col = c; 
        } 
        public Color Col 
        { 
            get 
            { 
                return this.col; 
            } 
            set 
            { 
                this.col = value; 
            } 
        } 
        public abstract int GetWheel();  		//˴ǳ󷽷ȥʵ 
        public void ShowColor()             	 
        { 
            Console.WriteLine("ɫΪ {0} ɫ",this.col); 
        } 
    } 
    public class MotorCycle:Car  
    { 
        private int SeatNumber; 
        public MotorCycle(){ }
        public MotorCycle(int s, Color c) : base(c) 	//:base(c)๹췽 
        {
            this.SeatNumber = s; 
        }    
        public new void ShowColor()//д 
        { 
            Console.WriteLine("ĦгɫΪ"+this.Col); 
        }
        public override int GetWheel()		//󷽷,ʵ 
        { 
            return 2; 
        } 
    } 
    public class Trunk:Car 
    { 
        private double length; 
        public Trunk(){ }
        public Trunk(double s, Color c): base(c) 	//:base(c)๹췽 
        {
            this.length = s;
        }
        public new void ShowColor()//д 
        {
            Console.WriteLine("ɫΪ" + this.Col);
        }
        public override int GetWheel()			//󷽷,ʵ
        {
            return 8;
        }
    }
    class Program
    {
        static void Main()
        {
            MotorCycle m = new MotorCycle(2, Color.yellow); 	//cΪCircle 
            m.ShowColor();
            Console.WriteLine("ĦгΪ" + m.GetWheel());
            m.Col = Color. orange;
            m.ShowColor();
            Trunk t = new Trunk(5, Color.blue); 		//sΪTrunk 
            t.ShowColor();
            Console.WriteLine("Ϊ" + t.GetWheel());
            t.Col = Color. purple;
            t.ShowColor(); 
            Console.ReadLine();
        } 
     }
}
