From: Walton Hoops Date: 2009-10-13T07:21:17+09:00 Subject: Re: Need Help with this problem > Ghost Alpha wrote: > > 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 aren't using constructors to define numberofwheels, keeldepth, and maxairspeed. In your code they are simply constant functions. > > 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 > > here is the link to the > > http://demo.ovh.org/en/8c779e3d297b9839114ac4c737c22065/ > -- > Posted via http://www.ruby-forum.com/.