All challenges

TypeScript · easy

Weekend rate

#23

Situation

Pricing currently treats every day as a weekday. Weekdays use 1x and weekends use 1.5x, or Saturday customers are charged the wrong rate.

Objective

Keep the base price on weekdays and apply a 1.5x multiplier on weekends. priceCents(100, "weekday")100; priceCents(100, "weekend")150.

The repo at start

workspace/
└── src/
    └── pricing.ts   (weekend surcharge never clocks in)

Checks you will turn green

  • exports priceCents
  • weekday keeps base
  • weekend applies 1.5x

Concepts

functions

Play it in your terminal

With sharpen installed, this command opens exactly this challenge in your local arena:

sharpen 23

First time? The full install is right below.

How to play

  1. 1 Install Claude Code if you do not have it yet: claude.com/claude-code
  2. 2 Install sharpen from npm:
    npm install -g @juanwmedia/sharpen
  3. 3 Then launch it; the arena opens in your browser:
    sharpen 23
  4. or Or try it without installing anything:
    npx @juanwmedia/sharpen 23
  5. 4 And to update when a new version ships:
    sharpen update