When Georgia runs, she runs a 6-mile loop each day. We don’t know how many days she runs, so we’ll call that number “d.” So, now we can say that Georgia runs 6d miles. (In other words, 6d is the expression that represents how much Georgia runs each week.)
Once you have your expression (6d), translating it to code is straightforward.
function calculateTotalDistance(days) {
// The expression 6d becomes 6 * days
const milesPerDay = 6;
return milesPerDay * days;
}
// Result for 5 days:
console.log(calculateTotalDistance(5)); // Output: 30