The preceding tally demo held the award constant while updating a running balance. The ticket desk needs the same distinction: keep basePrice fixed at 24, then update ticketPrice with a 5-unit facility charge and a 3-unit credit. The final ticket price should be 26.
For a different budget, the update pattern looks like this:
const grant = 50;
let balance = grant;
balance += 8;
balance -= 6;
console.log(balance); // 52
ticketPrice by facilityCharge with +=; the provided probe will log charged: 29.ticketPrice by credit with -=; the provided probe will log credited: 26.basePrice as base: 24.ticketPrice as ticket: 26.You can convert external price text, group charges correctly, and update a price without losing its fixed base. Take the section quiz before moving on to decisions.
Inspect the intermediate values in the Console before changing the final line.