A fruit is something that comes from a plant's flower and has seeds. Tomatoes fill both requirements. A vegetable is a part of the plant that grows outside of the reproductive process. A tomato does not fit this requirement
Squash is a fruit. Zucchini is a fruit. Cucumber is a fruit.
Coconut is a mammal.