the test class has
And in the end, I need to print everything that has been added,
toothbrush............$3.99
paste....................$7.79
I created the class with such
And while that sort of works for the name, although still wrong, it won't work for the cost. I'm stumped. Can anyone point me in the right direction?
Code:
a.add("toothbrush", 3.99);
a.add ("paste", 7.79);
And in the end, I need to print everything that has been added,
toothbrush............$3.99
paste....................$7.79
I created the class with such
Code:
void add(String name, double cost)
{
this.name = this.name + "\n" + name;
this.cost = cost;
}
And while that sort of works for the name, although still wrong, it won't work for the cost. I'm stumped. Can anyone point me in the right direction?