Track a Changing Points Tally
The volunteer desk awards a fixed number of points per completed shift. That rule does not change, but each volunteer's tally does. const names the fixed award; let names the changing tally.
javascript
const pointsPerShift = 6;
let tally = 10;
console.log("starting:", tally);
tally += pointsPerShift;
console.log("after shift:", tally);
tally += pointsPerShift;
console.log("after second shift:", tally);
+= changes the let binding; const pointsPerShift stays 6. A correction can subtract from the current tally:
javascript
const pointsPerShift = 6;
let tally = 10;
tally += pointsPerShift;
tally += pointsPerShift;
tally -= 2;
console.log("adjusted:", tally);
The next exercise changes a ticket price instead of a volunteer tally. Identify what stays fixed and what must change.