Question: Python Programming Abstraction: makeChange determines the minimum number of couns and bills needed to total to a specified monetary amount. action makeChange determines the minimimum

Python Programming
Abstraction: makeChange determines the minimum number of couns and bills needed to total to a specified monetary amount.
 Python Programming Abstraction: makeChange determines the minimum number of couns and
bills needed to total to a specified monetary amount. action makeChange determines

action makeChange determines the minimimum number of coins and bills needed to total to a specified monetary amount Invocation Prototype: makeChange(amount) Parameters: amount represents a quantity of money. It is a numeric value GEO and LT. 100. Mandatory. Arrives unvalidated.. Desired behavior (normal): Returns an 8-element python list denoting the miminum number of bills and coins that totalto amount. The list should be arranged as follows: List element Count of 0 20-dollar bills 1 10-dollar bills 2 5-dollar bills 3 1-dollar bills quarters dimes nickels pennies Special Note: amount should be rounded to the nearest penny before performing any Desired behavior (errors) if: Any parameter violates its respective interface contract described Action: Return an empty (ie, zero-element) list Exit conditions: No further processing takes place once an error is discovered. State change: No state is retained or changed. General examples: Samples that illustrate behavior with normal input Given: makeChange(3.26) Result [0.0.0.3,1,0,0.1) Given make change(5) Result [0,0,1,0,0,0,0,01 Given makeChange(36.41) Result (1.1.1.1.1.1.1.11 Given makechange (1.001) es that illustrate behavior with anomolous input Action: Return an empty (i.e., zero-element) list Exit conditions: No further processing takes place once an error is discovered State change: No state is retained or changed General examples: Samples that illustrate behavior with normal input Given: makeChange(3.26) Result [0,0,0,3,1,0,0,1) Given: makeChange(5) Result: [0,0,1,0,0,0,0,0] Given: makeChange(36.41) Result: [1,1,1,1,1,1,1,1) Given: makechange(1.001) Result: [0,0,0,1,0,0,0,0) Given: makechange(1.005) Result: [0,0,0,1,0,0,0,1) Given: makechange(amount=1.005) Result: [0,0,0,1,0,0,0,1] Samples that illustrate behavior with anomolous input Given: makeChange() Result: Given: makeChange("1.00") Result

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!