Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Implement the following outline
- Make a class Fruit
- In it will be these private variables
- (along with getters and setters)
- integer variable "seeds"
- string variable "name"
- Create a default constructor (seeds = 100, name = Watermelon)
- and one that takes in all variables
- Make a class Apple that is a child of Fruit
- Int it will be these private variables
- (along with getters and setters)
- boolean variable "red"
- Create a default constructor (red = true)
- and one that takes in all variables
- Create a function called eat that will decrease seeds by 10
- when called
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement