Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Sample output with input: 19 Change for $ 19 3 five dollar bill(s) and 4 one dollar bill(s) amount_to_change = int(input() num_fives - amount_to_change /

image text in transcribed
image text in transcribed
Sample output with input: 19 Change for $ 19 3 five dollar bill(s) and 4 one dollar bill(s) amount_to_change = int(input() num_fives - amount_to_change / 5 Your solution goes here 7 #Number of fives, found by integer division 8 num_fives - amount_to_change// 9 #Using modulo operator we get the number of ones 10 num_ones - amount_to_changes 11 we can now find the best intergers for change 12 find number of fives and ones 14 print('Change for $', amount_to_change) 15 print(num_fives, five dollar bill(s) and num_ones, 'one dollar bill(s) ) Run All tests passed Testing with input: 19 Your output change for $ 19 3 five dollax bill(s) and 4 one dollar bill(s) Testing with input: 6 Your output change for $ 6 1 five dollar bill(s) and 1 one dollar bill(s) View your last submission 5. Now you'll make some changes to increase the usability of this program. A typical cash register drawer has twenties, tens, fives, and ones. We want this program to determine the change that would be given from the cash register. 6. As you add more statements to the program, add a few comments that explain the major tasks performed in the program. (Comments in between lines of code are called "inline" comments.) 7. Before the line that calculates the number of fives, insert statements to calculate the number of twenties and tens. 8. On a separate line, before the numbers of fives and ones are printed, insert statements to print the number of twenties and tens. 9. Save the program. Run, Fix any errors. Run, test, debug, repeat... until you are sure that your program works correctly. Program 1, computingChange.py is now done. Program 2: Name this program ring Area.py 1. Start a new Python program. 2. Insert header comments as shown in program 1 above. 3. Write a program that will calculate the area of a ring (gray shaded area in the image below). The input will be two float numbers: the radius of the inner circle and the radius of the outer circle. Formula for area of a circle A r In Python, n is math.pi 4. The output should be the area of the ring. Include some meaningful text before the value of the area. (See example output below.) Sample program run: Radius of inner circle: 5 Radius of outer circle: 6 Area of the ring = 34.55751918948772 5. Include a few inline comments to document the major tasks in the program

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2014 Nancy France September 15 19 2014 Proceedings Part 2 Lnai 8725

Authors: Toon Calders ,Floriana Esposito ,Eyke Hullermeier ,Rosa Meo

2014th Edition

3662448505, 978-3662448502

More Books

Students also viewed these Databases questions

Question

4. Label problematic uses of language and their remedies

Answered: 1 week ago