← Unit 2 · all exercises
Saved in this browser only

Bulk discount

An order of 10 items or more takes 20 cents off the total. Return the total after any discount. The total is in cents.

int finalTotal(int items, int total)

Solution.java
Loading editor…
Results

Examples

  • finalTotal(12, 500) → 480
  • finalTotal(3, 500) → 500

There are also 4 hidden tests you can't see. Solve the problem, not the examples.