Skip to main content

Practice ยท 3 of 5

Shipping cost tiers

Implement int shippingCost(int items, boolean prime): free (0) when prime AND at least 1 item; 5 when NOT prime and items >= 10; 8 when NOT prime and items >= 3; 12 otherwise. Order your checks so the tiers fall out naturally.

Difficulty: beginner

Back to lesson: Practice: Practice: Decisions