NOTE: The completed code must pass in the following compiler. PLEASE make absolu
ID: 3576625 • Letter: N
Question
NOTE: The completed code must pass in the following compiler. PLEASE make absolutely sure it does before posting: http://codecheck.it/codecheck/files?repo=jfe1cc&problem=ch09/c09_exp_9_102
PLEASE also make sure of the following:
-Post this as text, not as an image.
-Avoid making alterations to the original code unless necessary.
-Post a SCREENSHOT of the passing output- from the this compiler specifically- as evidence this code was accepted and passed.
~
Form a subclass Quarter from the class Coin. A quarter has a state theme.
(image included in link above)
The getDescription method should yield a string such as
Complete the following code:
The following classes are used to check your work:
Explanation / Answer
class Quarter extends Coin
{
// your work here
String State;
/**
Constructs a quarter.
@param aValue the monetary value of the quarter.
@param aName the name of the quarter
*/
public Quarter(String aState)
{
// your work here
super(0.25,"Quarter");
State=aState;
}
public String getDescription()
{
// your work here
return super.getDescription() + ", state="+State;
}
}
Sample Output:
Quarter, value=0.25, state= Michigan
Expected: Quarter, value=0.25, state=Michigan
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.