Skip to content
Snippets Groups Projects

Shopping Cart Test added

Closed Usan, Victoria, Bc. requested to merge usanvict/eShop:master into master
Files
3
@@ -42,7 +42,7 @@ public class ShoppingCart {
*/
public void removeItem(int itemID) {
for (int i = items.size() - 1; i <= 0; i--) {
for (int i = items.size() - 1; i >= 0; i--) {
Item temp_item = (Item) items.get(i);
if (temp_item.getID() == itemID) {
items.remove(i);
@@ -63,7 +63,7 @@ public class ShoppingCart {
*/
public int getTotalPrice() {
int total = 0;
for (int i = items.size() - 1; i <= 0; i--) {
for (int i = items.size() - 1; i >= 0; i--) {
Item temp_item = (Item) items.get(i);
total += temp_item.getPrice();
}