but i need to do a single that with a sub class |
It's up to you. There are lot's of ways to skin a cat. A Car is certainly a sub-class of Vehicle but I think in terms of simplicity and clarity a Vehicle_Store is better treated separately.
by the way what do u mean by that i dont get it |
If I had commented that you don't get it, I would probably be able to answer you.
Am i doing the right thing with this
Car vehicles[80] |
If you just want to use a simple array then what you have is fine. The advantage of the object -oriented approach is a separate class for the store is more flexible.
(One of the best learning modes for your array is just try it out. 2 or 3 cars instead of 80 makes that aspect even easier. Just having make and model attributes for a car makes it even easier to test the ideas, fill out in more detail later.)
why do we need to remove it |
Only you know what is appropriate for your program. It's open-ended. Removal could be modelling a number of activities in possible systems - a car taken out of the garage to be sold, junked, painted, polished, stolen, rented out, loaned to a friend, out for repair and other endlessly possible scenarios. Or maybe cars once added to the list, never come off it. There for eternity.