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
Your code looks fine to me. To call getCost() in toString() method, simply just call it with getCost().
So your toString() method should be something like this:
public toString(){
String s;
s = brand + " ";
s += quantity + " " ;
s += itemCost + " ";
s += getCost();
return s;
}
Hope this is what you're looking for :)