 <p>One problem is that totalwtax is not being calculated correctly because any items that are zero rated for tax are not included in the total. Changing the else clause to this:</p> <pre><code> else { double newprice = Double.parseDouble(price); totalwtax +=newprice; shoppingcart.put(item, price); } </code></pre> <p>Produces this output for your test case:</p> <pre><code>Please enter an item.standard Please enter the price for standard: 12.49 Would you like to continue to add items? (Type Y) for Yes and (Type N) for No.y Please enter an item.music Please enter the price for music: 14.99 Would you like to continue to add items? (Type Y) for Yes and (Type N) for No.y Please enter an item.discount Please enter the price for discount: 0.85 Would you like to continue to add items? (Type Y) for Yes and (Type N) for No.n Your cart contains the following at items with tax{music=16.489, standard=12.49, discount=0.85} Total Tax: 29.829 </code></pre> <p>This still isn't exactly the same as the expected answer because the expected answer assumes some rounding in the calculation. You would either need to round the values yourself or it might be appropriate to use a Money class so that all the fractions of cents are correctly accounted for. </p>