示例#1
0
        private static void Homework1Examples()
        {
            Bicycle2     myBike     = new Bicycle2("BMX");
            MountainBike myMountain = new MountainBike();

            DownHillBike myDownhillBike = new DownHillBike();

            Console.WriteLine(myBike.WheelSpokes);
            Console.WriteLine(myMountain.WheelSpokes);

            Console.WriteLine(myDownhillBike.WheelSpokes);

            myMountain.MyMountainColor();
            myDownhillBike.MyMountainColor();
        }
示例#2
0
        private static void Homework1()
        {
            Console.WriteLine("------------------------------------");
            Console.WriteLine("Homework1 bicycle output begins here");
            Console.WriteLine("------------------------------------");

            Bicycle myBicycle = new Bicycle();

            myBicycle.MoveForward();
            myBicycle.NumofGears    = 10;
            myBicycle.HandlebarType = "Bullhorn handlebars";
            Console.WriteLine(myBicycle.HandlebarType);

            Console.WriteLine("----------------------------------------------");
            Console.WriteLine("Homework1b bicycle in-class output begins here");
            Console.WriteLine("----------------------------------------------");
            Bicycle1b    myBicycle1b    = new Bicycle1b();
            MountainBike myMountainBike = new MountainBike();

            Console.WriteLine("------------------------------------------------------");
            Console.WriteLine("Homework1b bicycle in-class output2 updates begin here");
            Console.WriteLine("------------------------------------------------------");

            Bicycle1b    myBike     = new Bicycle1b("BMX");
            MountainBike myMountain = new MountainBike();

            DownHillBike myDownhillBike = new DownHillBike();

            Console.WriteLine(myBike.WheelSpokes);
            Console.WriteLine(myMountain.WheelSpokes);

            Console.WriteLine(myDownhillBike.WheelSpokes);

            myMountain.MyMountainColor();
            myDownhillBike.MyMountainColor();
        }