Find the missing threshold test

A stationery supplier specifies item_total(n) for a nonnegative integer item count. An order of at least ten items costs 15 cents per item; a smaller order costs 20 cents per item. The function returns the total in cents, with no other fees.


A student implements:


Python
def item_total(n: int) -> int:
    if n > 10:
        return 15 * n
    return 20 * n


Tests with inputs 0, 4 and 12 expect 0, 80 and 180 cents, respectively, and all pass. Which statements correctly assess this design work? Select every correct statement.

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More The Design Recipe Questions: