<repo_name>moniir/StrategyPatternExample<file_sep>/src/ShoppingCart.java
import java.util.ArrayList;
import java.util.List;

public class ShoppingCart {

    List<Product> productList;

    public ShoppingCart() {
        this.productList = new ArrayList<>();
    }

    public void addProduct(Product product){
        productList.add(product);
    }
    public void repoveProduct(Product product){
        productList.remove(product);
    }

    public int calculateTotal(){
        int sum = 0;
        for(Product product: productList){
            sum+=product.getPrice();
        }
        return sum;
    }
    public void pay(Payment payment){
        int amount = calculateTotal();
        payment.pay(amount);


    }
}
