I get this message for the last part of this code for “cost”,
The method toDoubleString(double, boolean) in the type Convert is not applicable for the arguments (Double, int),
not sure how to fix this. if i take it out i get this message,
The method toLeftPaddedString(String, int) in the type Convert is not applicable for the arguments (Double, int).
Help, thanks.
public String printSummaryOutput() {
return Convert.toRightPaddedString(make, 8) + printSummaryOutput() +
Convert.toRightPaddedString(model, 11) + Convert.toLeftPaddedString(color, 6) +
Convert.toLeftPaddedString(purchaseDate, 10) + Convert.toLeftPaddedString(Convert.toDoubleString(cost, 10));
}
For the record, we don’t know what the
Convertclass is, nor what parameters its methods expect.However, something tells me that instead of…
…you may have meant…
…since the other invocations of
Convert.toLeftPaddedStringdo accept an integer argument for the second parameter.As others have stated, according to the error message, you need to supply a
booleansecond argument toConvert.toDoubleString, but that method may be overloaded; we cannot tell without more information.