Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Conceptual Database Design An Entity Relationship Approach

Authors: Carol Batini, Stefano Ceri, Shamkant B. Navathe

1st Edition

0805302441, 978-0805302448

More Books

Students also viewed these Databases questions

Question

What is the difference between Needs and GAP Analyses?

Answered: 1 week ago

Question

What are ERP suites? Are HCMSs part of ERPs?

Answered: 1 week ago