EXERCISE
Represent the products of a business using objects.
EXERCISE
Represent the products of a business using objects.
0
0
Checkbox to mark video as read
Mark as read

It's time to practice! Using what you've learned in the previous articles, create an App that meets the following requirements:

  • Create a collection of objects that represent different types of vehicles.
  • Use inheritance to have different types of vehicles with different properties and functions.
    • GasCar: numberOfWheels, startEngine()
    • ElectricCar: numberOfWheels, plug()
    • Truck: numberOfWheels, startEngine()
  • You'll need to use the following subclasses.
    • GasVehicle
    • ElectricVehicle
    • DeliveryVehicle
  • Avoid using protocols.
  • Create a list of Vehicle.
  • Call startEngine() of each Vehicle of your array.

0 Comments

Join the community to comment
Sign Up
I have an account
Be the first to comment

Accept Cookies

We use cookies to collect and analyze information on site performance and usage, in order to provide you with better service.

Check our Privacy Policy