A school orders custom T-shirts that cost $14 each. There is also a $60 design fee that must be paid once. Write an expression for the total cost for t shirts.
Implementing pricing logic is a common task in e-commerce applications.
function calculateOrder(quantity: number): number {
const pricePerShirt = 14;
const designFee = 60;
// Expression: 14t + 60
// Note: We use '+' to sum the costs
return (pricePerShirt * quantity) + designFee;
}
// Order for 30 students:
console.log(calculateOrder(30));
// (14 * 30) + 60 = 420 + 60 = 480