Functions are reusable blocks of code. Let's create helper functions to calculate totals.
calculateSubtotal(items) that sums up item pricescalculateDiscount(subtotal, percent) that returns discount amountsubtotal, discount, and finalTotalSubmit your code to see test results