G
Ghost Alpha
I am in this programming class and need help on this problem:
- Defines a Ruby class, Vehicle, with attributes weight, length width
and height. The Vehicle class should have a class variable counts the
number of vehicle objects created.
- Define three subclasses, landvehicle, watervehicle, and airvehicle so
they inherit the attributes of the vehicle class and so that each has
some attributes of its own, numberofwheels for landvehicles, keeldepth
for watervehicles, and maxairspeed or airvehicles
- creates 1 landvhicle objects, 2 watervehicle objects and 3 airvehicle
objects, use [ constructors ] in each subclass to assign initial values
of numberofwheels, keeldepth and maxairspeed to the appropriate objects.
You should invent the actual values to use when these objects are
created
- Display the number of vehicle objects created then ends.
attached is what i did, i was wondering if its correct
- Defines a Ruby class, Vehicle, with attributes weight, length width
and height. The Vehicle class should have a class variable counts the
number of vehicle objects created.
- Define three subclasses, landvehicle, watervehicle, and airvehicle so
they inherit the attributes of the vehicle class and so that each has
some attributes of its own, numberofwheels for landvehicles, keeldepth
for watervehicles, and maxairspeed or airvehicles
- creates 1 landvhicle objects, 2 watervehicle objects and 3 airvehicle
objects, use [ constructors ] in each subclass to assign initial values
of numberofwheels, keeldepth and maxairspeed to the appropriate objects.
You should invent the actual values to use when these objects are
created
- Display the number of vehicle objects created then ends.
attached is what i did, i was wondering if its correct