Print the numbers of the coins to be dispensed as change

Assignment Help JAVA Programming
Reference no: EM132101058

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: EM132101058

Questions Cloud

Write an essay on the topic Global Warming : Question - Write an essay on the topic "Global Warming". Ensure MLA guidelines are followed
Create an initial vector of that holds ten elements : Display values in sample array[10] Display the values in newarray[20] Attach Snipping Photos of Source Code and Output
New generation of young people entering : Technology, globalization, an emphasis on teams and a new generation of young people entering the workforce has dramatically
Which type of contract includes not-to-exceed price : Which type of contract includes a Not-to-Exceed Price? It must be definitized within 180 days.
Print the numbers of the coins to be dispensed as change : Prompt for the number of dollars in payment. If the payment is insufficient, print an error message and reprompt for payment.
What kind of performance standards hospitals : What kind of performance standards hospitals and fire stations need to guide its work force?
Supply chain relationships and global sourcing : Supply Chain Relationships and Global Sourcing. Explain the reasons why companies outsource.
Create a treeset to store any miss-spelled words : For each file in the command line parameter list, print out the name of the file before reading in any words.
Create a function that returns a vector of t : Consider an experiment of tossing a biased coin n = 100 times and recording the number of heads. Let the probability of heads be p = 0.7.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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