Question: 3. Choose one method from the MonetaryCoin class and give one paragraph of description in the space below. You can focus on one or two
3. Choose one method from the MonetaryCoin class and give one paragraph of description in the space below. You can focus on one or two of the following areas: 1) functional perspective such as what the method will do; or 2) implementation perspective such as whether the method is polymorphic, or overloaded, etc.
public class MonetaryCoin extends Coin { private int value; public MonetaryCoin(){ value = 0; } public MonetaryCoin(int aValue){ value = aValue; } public int getValue(){ return value; } public String toString(){ String faceName; if (isHeads()) { faceName = "head"; } else { faceName = "tail"; } return "The coin has "+faceName+" and value is "+value+"."; } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
