Esempio n. 1
0
        static void Main(string[] args)
        {
            //int age;
            //string name;
            MSSACar myWorkCar = new MSSACar(); //creating an instance of MSSACAr


            Console.WriteLine("what is the color of the car?: ");
            myWorkCar.Color = Console.ReadLine();

            myWorkCar.Color = CarColors.Black;
            myWorkCar.Year  = 2025;
            //myWorkCar._ye
            myWorkCar.Make = CarMake.Mazda;
            //myWorkCar.TotalMiles = 0;  //not allowed
            myWorkCar.MPG          = 30;
            myWorkCar.FuelLevel    = 25;
            myWorkCar.IsFirstOwner = true;
            myWorkCar.Model        = "SUV";



            myWorkCar.Drive(20);
            myWorkCar.PrintMe();
            myWorkCar.Drive(100);
            myWorkCar.PrintMe();

            MSSACar myWishCar = CallMeMethod();

            myWishCar.Drive(1000);
            myWishCar.PrintMe();

            Console.WriteLine(myWorkCar);
            Console.WriteLine(myWishCar);
        }
Esempio n. 2
0
        public static MSSACar CallMeMethod()
        {
            MSSACar myDreamCar = new MSSACar(CarColors.Red, 1972, CarMake.Chevy, 12, 15.3, false, "Camaro"); //calling the non-default constructor


            myDreamCar.PrintMe();
            //Console.WriteLine(CarColors.Green);
            return(myDreamCar);
        }