Question: Directions Although Python 2.x is used in the lecture, feel free to use Python 3. If you do, be sure to indicate. Your programs must
Directions
Although Python 2.x is used in the lecture, feel free to use Python 3. If you do, be sure to indicate.
Your programs must be save in a file with extension .py so they can be run from the command line as: python youfile.py
For every program, you must first develop an algorithm. The instructions or steps of the algorithm will become the comments in your code.
Your output should be formatted exactly as the sample runs provided, including the precisions for decimal numbers.
Introduction
This is the introductory part and doesnt use control structure, functions, or files I/O.
The learning objectives are twofold:
Develop proper algorithm for solving a given program. The instructions in the algorithm will serve as comments in your program
Turn the algorithm into code
Activities
Part 1: Minimum Number of Coins
Suppose you want to develop a program that classifies a given amount of money into smaller monetary units. The program lets the user enter an amount as a floating-point value representing a total dollars and cents, and then outputs a report listing the monetary equivalent in dollars, quarters, dimes, nickels, and pennies.
Your program should report the maximum number of dollars, then the number of quarters, dimes, nickels, and pennies, in this order, to result in the minimum number of coins.
Sample Run
Enter an amount, for example, 11.56: 11.56
Your amount 11.56 consists of:
11 dollars
2 quarters
0 dimes
1 nickels
1 pennies
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
