Prompt the user for a price in the form xx middot xx

Assignment Help C/C++ Programming
Reference no: EM132107276

Your program must meet the following specifications:

At program start, assume a stock of 10 nickels, 10 dimes, 10 quarters, and 10 pennies. Repeatedly prompt the user for a price in the form xx middot xx, where x denotes a digit, or to enter 'q' to quit.

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 I 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 Just before quitting, print the total amount (the number of dollars and number of cents) left in the stock.

Reference no: EM132107276

Questions Cloud

Relationship between being overweight or obese : 1. What symptoms of type 2 diabetes does Mrs. Folley manifest? Explain the pathophysiology of these symptoms.
Displays a count down to zero from a number supplied : Displays a count down to zero from a number supplied by the user at the command line.
Discuss the complications of liver disease : Patient presents with malnutrition secondary to liver disease. Name two (2) nutrition or medical problems and discuss the complications of liver disease
Write a function called reverselist that creates a new list : Write a function called reverseList that creates a new linked list containing student_t nodes of an input linked list in the reverse order without destroying.
Prompt the user for a price in the form xx middot xx : 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').
Write a program that creates a vector of strings : Write a program that creates a vector of strings called V. Vector V grows and shrinks as the user processes the transactions from a data file called data.txt.
Write a program that prompts for and reads in two names : Write a program Names.java that does the followingm prompts for and reads in two names from the user.
Create a prototype for an application : A small hospital has contacted you and asked you to create a prototype for an application that can handle all of their administrative activities.
Simulate arcade car racing game : If you get to the end of the screen, the car should start over on the left side of the screen. The AI car should start over but should move faster this time.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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