Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Step 1 Write a python program that counts the number and value of coins in your 'pocket.' 1. Prompt the user for the number of

Step 1

Write a python program that counts the number and value of coins in your 'pocket.'

1. Prompt the user for the number of each type of coin.

2. Calculate the value of each kind of coin and then the value of all the coins in the collection.

The output of your program should resemble:

The total value of your change is $3.72 with $2.75 in quarters, $0.60 in dimes, $0.30 in nickels, and $0.07 in pennies.

Step 2

1. Write a modification of your program so that it calculates the change that should be returned in a transaction.

2. Take as input, the cost of the item(s), the amount received in payment and the change that needs to be given.

The output might resemble this: Thank you for your purchase.

Your total cost is $23.32, you gave us $30.00. We are returning $6.68: $6.00 in bills, $0.50 with 2 quarters, $0.10 with 1 dimes, $0.05 with 1 nickels and $0.03 with 3 pennies.

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

Information Modeling And Relational Databases

Authors: Terry Halpin, Tony Morgan

2nd Edition

0123735688, 978-0123735683

Students also viewed these Databases questions