Which replacements preserve the abstraction?

A checkout program calls rebate_cents(p), where p is any nonnegative integer purchase amount in cents. The procedure returns p // 10 cents. Here, // means whole-number division with the remainder discarded, and % gives the remainder. The procedure prints nothing and makes no changes outside its local calculation. No execution-speed requirement is specified.


Which proposed replacements preserve the specified behavior for every accepted input? Select all that apply.

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 Procedural and Data Abstraction Questions: