School T-Shirt Order

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.

$14
×
t
Shirt Cost
Price per shirt × Quantity
+
$60 Design Fee
One-time fixed cost
Why "+"?Total = Shirts Cost AND Design Fee
=
14t + 60
Total Cost Equation

School T-Shirt Order

Ordering merchandise often involves a unit price plus a setup fee. Let's model the cost for a school T-shirt order.
Continue

1. The Unit Cost

Each shirt costs $14. This is the variable part because it depends on how many shirts you buy. For 't' shirts, it's 14 * t.
Continue

2. The Design Fee

There is a standard $60 design fee. You pay this once, regardless of whether you order 1 shirt or 1000 shirts.
Continue

3. Total Expression

We use '+' to combine the costs because the final bill includes BOTH the shirts AND the fee. Expression: 14t + 60.
Continue

Your Turn

Try modeling a different supplier's pricing. This 'mx + b' skill is crucial for comparing vendor quotes in real life.
Continue

Order Calculator

Implementing pricing logic is a common task in e-commerce applications.

calculateOrderTotal.ts
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
TypeScript Pricing Function
AlgoAnimator: Interactive Data Structures