Question: create a java class program 3. Class PLaver: 1. A Player object has two attributes: a String name that stores a gardener's name, and a

 create a java class program 3. Class PLaver: 1. A Player

object has two attributes: a String name that stores a gardener's name,

create a java class program

3. Class PLaver: 1. A Player object has two attributes: a String name that stores a gardener's name, and a Garden object garden which is this player's board game. 2. A constructor which takes two parameters, a String for the player's 3. 4. name and an integer for the size of the garden. An Accessor/get method for the name attribute The following methods are all methods that will have the garden attribute call the corresponding method from the Garden class. This is necessary since garden is a private attribute of the class Player. countPossibleFLowers() by the attribute garden countPossibleTrees () by the attribute garden i. howManyFLowersPossible() which will return the result of a call to the method ii. howMany TreesPossible() which will return the result of a call to the method iii. whatIsPlanted(int r, int c) which will return the result of a call to the iv. plantTreeInGarden(int r, int c) which will call the method plantTree() to v. plantFLowerInGarden(int r, int c) which will call the method plantFlower method getInLocation(r, c) by the attribute garden. plant a flower in garden in location [r][c] to plant a tree in garden in location[r][c], [r+1][c], [r]lc+1] and [r+1][c+1] flower in garden in location [rlIc], which means assigning a "-'to the location vi. eatHere(int r, int c) which will call the method removeFLower)to removea

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!