コード例 #1
0
ファイル: Program.cs プロジェクト: Asbee/Demo05
        static void Main(string[] args)
        {
       
            Tyres tyres = new Tyres();
            Vehicle vehicle = new Vehicle();


            //Nokia tyres
            tyres.Model = "HakkaPeliitta";
            tyres.Size = "205R16";
            tyres.Name = "Nokia";

            //MIC tyres
            tyres.Model = "Pilot ";
            tyres.Size = "160R17 ";
            tyres.Name = "MIC ";

            //create a car
            
            
            vehicle.Name = "Porsche";
            vehicle.Model = "911";
            vehicle.AddTyres(tyres);
            vehicle.AddTyres(tyres);
            vehicle.AddTyres(tyres);
            vehicle.AddTyres(tyres);
            

            Console.WriteLine(vehicle.ToString());

            Console.WriteLine("Press any key...");
            Console.ReadKey();
            
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: H8262/Demo05
        static void Main(string[] args)
        {
            Vehicle vechicle = new Vehicle {Model = "Auto", Name = "Lada" };
            Tyre tyre = new Tyre { Name = "Nokia", Model = "Hakkapeliitta", Size = "Iso" };

            vechicle.AddTyres(tyre);
            vechicle.AddTyres(tyre);
            vechicle.AddTyres(tyre);
            vechicle.AddTyres(tyre);

            Console.WriteLine(vechicle.ToString());
        }