Hi,

I'm writing a program and part of the specification requires the users to be able to add new objects.

I've made a little diagram which is attached:


My question is how to gather the information from the user.

Should I first ask the user for the attributes for the Vehicles base class, then make the last question 'Is it a Car or a Bike?', gather all the details for either the car or the bike, then again make the last question is it a Sports Bike or a Trails bike, and then ask for the attributes of this derived class?

Would this method work OK?

I've never used inheritance before, so am unsure on the best approach to take.

Many thanks for any advice! It's most welcome