Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Vehicle baseVehicle = new Vehicle(4, 2000, "Green", 55.0d);

            baseVehicle.Move();

            //Checking to make sure vehicle moves

            baseVehicle.Move();
            Console.WriteLine(baseVehicle.DistanceTraveled);
            Console.WriteLine();

            //Defining the Automobile and moving it
            Automobile herbie = new Automobile(4, 13, 2, 4, 1500, "white", 88.0d);

            herbie.Move();
            Console.WriteLine("Automobile " + herbie.GetDistanceTraveled());
            Console.WriteLine();

            Boat boaty = new Boat(2, 500, "Red", 88.0d, .9d);

            boaty.Move();
            Console.WriteLine("Boaty " + boaty.GetDistanceTraveled());
            Console.WriteLine();

            Aircraft aircraft1 = new Aircraft(70, 100000, "Grey", 600.0d);

            aircraft1.Move();
            aircraft1.Move();
            Console.WriteLine("Aircraft traveled: " + aircraft1.GetDistanceTraveled());
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Boat ssSonja = new Boat(2, 500, "red", 80.0d, .90d);

            ssSonja.Move();
            ssSonja.Move();
            Console.WriteLine("Boat " + ssSonja.GetDistanceTraveled());
            Automobile tesla = new Automobile(4, 22, 2, 2, 500, "Yellow", 250d);

            tesla.Move();
            Console.WriteLine("car " + tesla.GetDistanceTraveled());
        }