Assume that the classes listed in the Java Quick Reference have been imported where appropriate.
Unless otherwise noted in the question, assume that parameters in method calls are not null and that methods are called only when their preconditions are satisfied.
In writing solutions for each question, you may use any of the accessible methods that are listed in classes defined in that question. Writing significant amounts of code that can be replaced by a call to one of these methods will not receive full credit.
The ExperimentalFarm class represents crops grown on an experimental farm. An experimental farm is a rectangular tract of land that is divided into a grid of equal-sized plots. Each plot in the grid contains one type of crop. The crop yield of each plot is measured in bushels per acre.
A farm plot is represented by the Plot class. A partial definition of the Plot class is shown below.
public class Plot
{
private String cropType;
private int cropYield;
public Plot(String crop, int yield)
{
/* implementation not shown */
}
public String getCropType()
{
return cropType;
}
public int getCropYield()
{
return cropYield;
}
}