2
private final int[] prices;4
private final int discount;5
private int customerNumber;7
public Cashier(int n, int discount, int[] products, int[] prices) {8
this.prices = new int[200];10
for (int i = 0; i < products.length; ++i) this.prices[products[i] - 1] = prices[i];13
this.discount = discount;14
this.customerNumber = 1;17
public double getBill(int[] product, int[] amount) {20
for (int i = 0; i < product.length; ++i) sum += this.prices[product[i] - 1] * amount[i];22
if (this.customerNumber != 0 && this.customerNumber % n == 0)23
sum *= (double) (100 - this.discount) / 100;25
this.customerNumber++;32
* Your Cashier object will be instantiated and called as such: Cashier obj = new Cashier(n,33
* discount, products, prices); double param_1 = obj.getBill(product,amount);