Advertisement
Guest User

Untitled

a guest
Sep 19th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. Implement the following outline
  2.  
  3. Make a class Fruit
  4. In it will be these private variables
  5. (along with getters and setters)
  6. integer variable "seeds"
  7. string variable "name"
  8. Create a default constructor (seeds = 100, name = Watermelon)
  9. and one that takes in all variables
  10.  
  11. Make a class Apple that is a child of Fruit
  12. Int it will be these private variables
  13. (along with getters and setters)
  14. boolean variable "red"
  15. Create a default constructor (red = true)
  16. and one that takes in all variables
  17. Create a function called eat that will decrease seeds by 10
  18. when called
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement