static void Main(string[] args) { // create a new instance of Car //Car myCar = new Car("Adam Freeman", "Black", 30); //myCar.PrintCarDetails(); // create an instance of VolvoCar //VolvoCar myVolvo = new VolvoCar("Adam Freeman", "Black", 30, "High Performance"); //myVolvo.PrintCarDetails(); //int fuelRequired = myVolvo.CalculateFuelForTrip(1000); //Console.WriteLine("Fuel Required: {0} gallons", fuelRequired); VolvoC30 myC30 = new VolvoC30("Adam Freeman", "Black", 30, "High Performance"); myC30.PrintCarDetails(); FordFiesta myFiesta = new FordFiesta("Joe Smith", "Yellow", 35, "18 inch sports"); myFiesta.PrintCarDetails(); // wait for input before exiting Console.WriteLine("Press enter to finish"); Console.ReadLine(); }
static void Main(string[] args) { // create a VolvoC30 object VolvoC30 myVolvo = new VolvoC30("Adam Freeman", "Black"); // create a FordFiesta object FordFiesta myFord = new FordFiesta("Joe Smith", "Green"); // call the PrintCarDetails method on both car objects myVolvo.PrintCarDetails(); myFord.PrintCarDetails(); // wait for input before exiting Console.WriteLine("Press enter to finish"); Console.ReadLine(); }