示例#1
0
文件: Program.cs 项目: H8872/Demo5
        static void Main(string[] args)
        {
            //Tyres
            Tyre nokia = new Tyre { Name = "Nokia", Model = "Hakkapeliitta", Size = "205R16" };
            Tyre micb = new Tyre { Name = "Mic", Model = "Pilot", Size = "160R17" };
            Tyre mics = new Tyre { Name = "Mic", Model = "Pilot", Size = "140R16" };


            //Vehicles
            Vehicle porsche = new Vehicle();
            porsche.Name = "Porsche";
            porsche.Model = "911";
            porsche.AddTyre(nokia);
            porsche.AddTyre(nokia);
            porsche.AddTyre(nokia);
            porsche.AddTyre(nokia);

            Vehicle ducati = new Vehicle();
            ducati.Name = "Ducati";
            ducati.Model = "Diavel";
            ducati.AddTyre(micb);
            ducati.AddTyre(mics);

            //Print stuff
            Console.WriteLine(porsche.ToString());
            Console.WriteLine(ducati.ToString());

            Console.ReadLine();
        }
示例#2
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();
            
        }
示例#3
0
        static void Main(string[] args)
        {
            Tyres tyre1 = new Tyres { Name = "nokia", Model = "Hakkapeliitta", Size = "21" };
            Tyres tyre2 = new Tyres { Name = "nokia", Model = "Hakkapeliitta", Size = "18" };
            /*tyre.Name = "nokia";
            tyre.Model = "Hakkapeliitta";
            tyre.Size = "21";*/


            Vehicle vehicle = new Vehicle { Name = "Ferrari", Model = "458" } ;
            /* vehicle.Name = "Ferrari";
             vehicle.Model = "458";*/
            vehicle.AddTyre(tyre1); //car contains tyres..
            vehicle.AddTyre(tyre1);
            vehicle.AddTyre(tyre2);
            vehicle.AddTyre(tyre2);

            Console.WriteLine(vehicle.ToString());





            Console.ReadLine();



        }
示例#4
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());
        }
示例#5
0
        static void Main(string[] args)
        {
            // create tyre
            Tyre tyre = new Tyre { Name = "Nokia", Model = "Hakkapeliitta", Size = "205R16" };

            Vehicle car = new Vehicle { Name = "Porsche", Model = "911" };
            car.AddTyre(tyre); // car contains tyres... D:
            car.AddTyre(tyre); // car contains tyres... D:
            car.AddTyre(tyre); // car contains tyres... D:
            car.AddTyre(tyre); // car contains tyres... D:

            Console.WriteLine(car.ToString());
            Console.ReadLine();
        }
示例#6
0
        static void Main(string[] args)
        {
            Tyre tyre = new Tyre { Name = "Nokia", Model = "Hakkapeliitta", TyreSize = "205R16" };

            Vehicle car = new Vehicle { Name = "Datsun", Model = "100A" };
            car.AddTyre(tyre);
            car.AddTyre(tyre);
            car.AddTyre(tyre);
            car.AddTyre(tyre);

            Console.WriteLine(car.ToString());

            Console.WriteLine("Press enter key to continue...");
            Console.ReadLine();
        }
示例#7
0
文件: Program.cs 项目: HautaN7/Demo05
        static void Main(string[] args)
        {
            // create tyre
            Tyre tyre = new Tyre { Name = "Nokia", Model = "Hakka", TyreSize = "205R16" };

            // create car
            Vehicle car = new Vehicle();
            car.Name = "Audi";
            car.Model = "R8";
            car.AddTyre(tyre);
            car.AddTyre(tyre);
            car.AddTyre(tyre);
            car.AddTyre(tyre);

            Console.WriteLine(car.ToString());
            Console.WriteLine("Press enter to continue...");
            Console.ReadLine();
        }