The preceding expense demo converted text prices and separated per-night costs from a one-time fee. Now an event team must price three guests: admission is "18" per guest, refreshments are "4" per guest, and a one-time service fee is "6". The total should be 72.
A different supply order follows the same shape:
const pens = Number("3");
const folders = Number("2");
const kits = 4;
const delivery = Number("5");
console.log((pens + folders) * kits + delivery); // 25
admissionText with Number() into admission; the provided probe will log admission: 18 (number).refreshmentText with Number() into refreshment; the provided probe will log refreshment: 4 (number).feeText with Number() into fee; the provided probe will log fee: 6 (number).admission and refreshment as per guest: 22.totalExpense by multiplying the grouped per-guest sum by guests, then adding fee; the provided probe will log expense total: 72.Inspect the intermediate values in the Console before changing the final line.