Determine the coins to be dispensed as change

Assignment Help Computer Engineering
Reference no: EM132101163

PLEASE USE PYTHON SPYDER

Your program must meet the following specifications:

1. At program start, assume a stock of 10 nickels, 10 dimes, 10 quarters, and 10 pennies.

2. Repeatedly prompt the user for a price in the form xx.xx, where x denotes a digit, or to enter ‘q' to quit. 3. When a price is entered: a. If the price entered is negative, print an error message and start over requesting either a new price or to quit (indicated by entering a ‘q').

b. Prompt for the number of dollars in payment. If the payment is insufficient, print an error message and reprompt for payment.

c. Next determine the coins to be dispensed as change. This calculation will depend on the amount to be dispensed and also on the number of coins left in the stock. For example, the least number of coins needed to make change of $1.30 is 6: 5 quarters and 1 nickel. But if there are only 3 quarters, 3 dimes, and 10 nickels left in the stock, then the least number is 11: 3 quarters, 3 dimes, and 5 nickels.

d. Print the numbers of the coins to be dispensed as change and their denominations. (Omit a denomination if no coins of that denomination will be dispensed.)

e. In case exact payment is made, print a message such as "No change."

f. If the change cannot be made up with the coins remaining, print an error message and halt the program

4. Just before quitting, print the total amount (the number of dollars and number of cents) left in the stock.

Reference no: EM132101163

Questions Cloud

Why do you think union membership has been declining : Why do you think union membership has been declining? Do you think the downward trend will continue?
Create a function that returns a vector of using matlab : Let the probability of heads be p = 0.7. Create a function that returns a vector of t = 10000 trials of the experiment.
Cost of correcting the defective widgets : Who should bear the cost of correcting the defective widgets delivered in the first lot under Contract B?
Compare your histogram with the pdf plot obtained : Add graphical parameters to your plot and save it as a .jpg file. Compare your histogram with the pdf plot obtained in the previous problem.
Determine the coins to be dispensed as change : Determine the coins to be dispensed as change. This calculation will depend on the amount to be dispensed and also on the number of coins left in the stock.
Why needs an organization to be restructured : Why needs an organization to be restructured and what need to be consider it while restructuring it and whats
Assess and improve ability to reason : What is the standards for critical thinking use to assess and improve your ability to reason.
Create an if statement that is unconditionally true : Write short Java statements to complete each of the following tasks: Test whether variable x is less than 5. If it is, print "x is less than 5".
What is the average unit cost of the order : Suppose Company X decides to buy 8,000 units from Supplier A. What is the average unit cost of the order?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd