Skip to the lesson

CodingLesson 3 of 6

Part 1 of 3, 0 done

14 min

If the cart is fifty dollars or more: business rules

"Free shipping on orders of $50example (example number: Simplified example: the store's free-shipping line, not any real store's policy.) or more." One symbol in the code decides whether a customer at exactly that amount pays.

Ticket 01 · Your turn

Exactly at the line

The store's banner says free shipping on orders of $50example (example number: Simplified example: the store's free-shipping line, not any real store's policy.) or more. A customer's cart comes to exactly $50.00example (example number: Simplified example: a cart right at the line.). Here's the shipping code. What does it charge for shipping?

IF (cart > 50)
{
   shipping ← 0
}
ELSE
{
   shipping ← 6
}

What you know

Cart total
$50.00
Shipping fee in the code
$6

These numbers are our example.

$
Words to know

Spot something wrong?

Tell us what looks off. No name or email needed.

What kind of problem?

0 / 1000

We'll also send this page, the lesson, ticket 1, so we can find it. Nothing else. Privacy

·
Sources and every number

Every number

  • $50example (example number: Simplified example: the store's free-shipping line, not any real store's policy.) · Simplified example: the store's free-shipping line, not any real store's policy.
  • $50.00example (example number: Simplified example: a cart right at the line.) · Simplified example: a cart right at the line.
  • $6example (example number: Worked out from the code: the cart isn't more than the line, so the ELSE block sets the fee.) · Worked out from the code: the cart isn't more than the line, so the ELSE block sets the fee.
  1. Lessons›
  2. The school›
  3. Coding
  • ·Before this: The till that remembers: variables
  • ·Next: Loops: working through the order queue
Skip to the lesson

CodingLesson 3 of 6

Part 1 of 3, 0 done

14 min

If the cart is fifty dollars or more: business rules

"Free shipping on orders of $50example (example number: Simplified example: the store's free-shipping line, not any real store's policy.) or more." One symbol in the code decides whether a customer at exactly that amount pays.

Ticket 01 · Your turn

Exactly at the line

The store's banner says free shipping on orders of $50example (example number: Simplified example: the store's free-shipping line, not any real store's policy.) or more. A customer's cart comes to exactly $50.00example (example number: Simplified example: a cart right at the line.). Here's the shipping code. What does it charge for shipping?

IF (cart > 50)
{
   shipping ← 0
}
ELSE
{
   shipping ← 6
}

What you know

Cart total
$50.00
Shipping fee in the code
$6

These numbers are our example.

$
Words to know

Spot something wrong?

Tell us what looks off. No name or email needed.

What kind of problem?

0 / 1000

We'll also send this page, the lesson, ticket 1, so we can find it. Nothing else. Privacy

·
Sources and every number

Every number

  • $50example (example number: Simplified example: the store's free-shipping line, not any real store's policy.) · Simplified example: the store's free-shipping line, not any real store's policy.
  • $50.00example (example number: Simplified example: a cart right at the line.) · Simplified example: a cart right at the line.
  • $6example (example number: Worked out from the code: the cart isn't more than the line, so the ELSE block sets the fee.) · Worked out from the code: the cart isn't more than the line, so the ELSE block sets the fee.
  1. Lessons›
  2. The school›
  3. Coding
  • ·Before this: The till that remembers: variables
  • ·Next: Loops: working through the order queue