Fruit or vegetable?

Ask anyone in class 8 how they know whether it is a fruit of vegetable and they will be able to explain how scientists know!