class Car : Vehicle{
enum KindOfCar{
case electric, combustion
}
var kindOfCar = KindOfCar.self
var maxSpeed = 0.0
}
class ElectricCar : Car{
var autonomy = 0.0
}
class CombustionCar : Car{
var performance = 0.0
}
let electricCar = ElectricCar()
electricCar.kindOfCar.electric
electricCar.maxSpeed = 220
electricCar.autonomy = 450
let combustionCar = CombustionCar()
combustionCar.kindOfCar.combustion
combustionCar.maxSpeed = 200
combustionCar.performance = 8
¿Quieres ver más aportes, preguntas y respuestas de la comunidad?