Example #1
0
        public static void Main(string[] args)
        {
            Console.WriteLine("***Fun With Class Types ****");
            Car myCar = new Car
            {
                currSpeed = 10,
                petName   = "Jetta"
            };

            // speed up the car a few times and print our the new stat

            for (int i = 0; i <= 10; i++)
            {
                myCar.SpeedUp(5);
                myCar.PrintState();
            }

            //Invoking the default Constructor
            Car chuck = new Car();

            // Prints Chuck is going 10 MPH
            chuck.PrintState();

            // Make  a Car called Marry going 0MPH
            Car mary = new Car("Mary");

            mary.PrintState();

            // Make a Car called Daisy going 75MPH
            Car daisy = new Car("Daisy", 75);

            daisy.PrintState();


            // Using default constructor on Motorcycle class
            Console.WriteLine("MotorCycle Class");
            MotorCycle mc = new MotorCycle();

            mc.PopAWheely();

            // make Motorcyle with a rider named Tiny

            MotorCycle c = new MotorCycle(5);

            c.SetDriverName("Tiny");

            c.PopAWheely();
            Console.WriteLine($" Rider name is  {c.driverName}");

            MakeSomeBikes();
        }