Esempio n. 1
0
        private void btnAnyCar_Click(object sender, EventArgs e)
        {
            Automobile myAuto = new Automobile();
            Automobile myOtherAuto = new Car();
            Automobile myOtherAutoT = new Truck();
            Automobile myOtherAutoS = new SUV();

            myAuto.Price = 100M;
            myAuto.Mileage = 10;
            myAuto.StartEngine();

            myOtherAutoS.Make = "New SUV!";
            myOtherAutoS.Mileage = 12;
            myOtherAutoS.Price = 22000M;
            myOtherAutoS.StartEngine();
            myOtherAutoS.ShowInfo();

            myOtherAuto.StartEngine();
            myOtherAutoT.Price = 100000M;
            myOtherAutoT.Mileage = 10;
            myAuto.ShowInfo();
            myOtherAutoT.ShowInfo();

            //tryStartingAgain(myAuto);
            //tryStartingAgain(myOtherAuto);

            //Car coolCar = (Car) new Automobile();
            //MessageBox.Show("Test: " + myOtherAuto.Doors);
            //Cannot access
        }
Esempio n. 2
0
        private void btnAnyCar_Click(object sender, EventArgs e)
        {
            Automobile myAuto       = new Automobile();
            Automobile myOtherAuto  = new Car();
            Automobile myOtherAutoT = new Truck();
            Automobile myOtherAutoS = new SUV();

            myAuto.Price   = 100M;
            myAuto.Mileage = 10;
            myAuto.StartEngine();

            myOtherAutoS.Make    = "New SUV!";
            myOtherAutoS.Mileage = 12;
            myOtherAutoS.Price   = 22000M;
            myOtherAutoS.StartEngine();
            myOtherAutoS.ShowInfo();


            myOtherAuto.StartEngine();
            myOtherAutoT.Price   = 100000M;
            myOtherAutoT.Mileage = 10;
            myAuto.ShowInfo();
            myOtherAutoT.ShowInfo();

            //tryStartingAgain(myAuto);
            //tryStartingAgain(myOtherAuto);


            //Car coolCar = (Car) new Automobile();
            //MessageBox.Show("Test: " + myOtherAuto.Doors);
            //Cannot access
        }
Esempio n. 3
0
 private void btnStartCar_Click(object sender, EventArgs e)
 {
     Car myCar = new Car();
     myCar.StartEngine();
 }
Esempio n. 4
0
        private void btnStartCar_Click(object sender, EventArgs e)
        {
            Car myCar = new Car();

            myCar.StartEngine();
        }