What I am supposed to do:
Add some necessary statements to the
printOrderCost()
method in the main class so that this method computes and p
From the code you have supplied, the getCost
method "looks" fine
Your toString
method should simply need to be appended to your return
String
s
public String toString() // not necessary to format the output
{
String s;
s = brand + " ";
s += quantity + " " ;
s += itemCost + " ";
s += getCost();
return s;
}
You might also like to take a look at NumberFormat, which will allow you to control the output format, just in case you get a funny looking value ;)