The Problem:
A supermarket sells 3 products listed below: Product A = $20
Product B = $50 (or 5 for the price of 3)
Product C = $30
Implement the code for a checkout register that calculates the price of a given sequence of items. The input is a product list as a String, e.g “ABBACBBAB” : for which the output should be the integer 240. Please consider testability, documentation, and other good coding practices in your solution. As an additional challenge, consider how new pricing rules might be provided programmatically.
Implement the following:
public class Supermarket {
public int checkout(String items);
}