Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Solve in python Problem 3. Computing Change (includes 10 extra credit points) Write a program p3.py that computes the equivalent of a dollar amount in

Solve in python

image text in transcribed

Problem 3. Computing Change (includes 10 extra credit points) Write a program p3.py that computes the equivalent of a dollar amount in change using quarters, dimes, and pennies. No nickels are used for conversion. The program reads from the terminal the dollar amount in a loop while not end-of-file. Inside the loop it computes how many quarters, dimes, and pennies make up the original dollar amount and then displays the change. The program should terminate if the user types an invalid string Here is a sample user session, with input highlighted in yellow: Enter amount: 10 $10 makes 40 quarters, ? dimes, and ? pennies (40 coins), total amount n coins: $10 Enter amount: ?.24 $0.24 makes ? quarters, 2 dimes, and 4 pennies (6 coins), total amount in coins: $0.24 Enter amount: se makes ? quarters , ? dimes, and ? pennies (? coins), total amount in coins : $? Enter amount: 99.99 $99.99 makes 399 quarters, 2 dimes, and 4 pennies (405 coins), total amount in coins: $99.99 Enter amount: 3.45 $3.45 makes 13 quarters, 2 dimes, and ? pennies (15 coins), total amount in coins : $3.45 Enter amount: 5.25 $5.25 makes 21 quarters, ? dimes, and ? pennies (21 coins), total amount in coins : $5.25 10.12 Invalid input. (user types CTRL-Z on Windows to enter EOF and finish 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

More Books

Students also viewed these Databases questions

Question

3.What are the Importance / Role of Bank in Business?

Answered: 1 week ago