5. Write a program that determines the change to be dispensed from a vending machine. An item in the machine can cost between 25 cents and a dollar, in 5-cent increments (25, 30, 35, ... , 90, 95, or 100), and the machine accepts only a single dollar bill to pay for the item. For example, a possible dialogue with the user might be Don't forget to put the exclan a Enter price of item (from 25 cents to a dollar, in 5-cent increments): 45 You bought an item for 45 cents and gave me a dollar, so your change is 2 quarters, 0 dimes, and 1 nickel.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 21PE
icon
Related questions
Question

the problem is attached 

5. Write a program that determines the change to be dispensed from a
vending machine. An item in the machine can cost between 25 cents and
a dollar, in 5-cent increments (25, 30, 35, ... , 90, 95, or 100), and the
machine accepts only a single dollar bill to pay for the item. For example,
a possible dialogue with the user might be
Don't forget to put the exclan
a
Enter price of item
(from 25 cents to a dollar, in 5-cent increments): 45
You bought an item for 45 cents and gave me a dollar,
so your change is
2 quarters,
0 dimes, and
1 nickel.
Transcribed Image Text:5. Write a program that determines the change to be dispensed from a vending machine. An item in the machine can cost between 25 cents and a dollar, in 5-cent increments (25, 30, 35, ... , 90, 95, or 100), and the machine accepts only a single dollar bill to pay for the item. For example, a possible dialogue with the user might be Don't forget to put the exclan a Enter price of item (from 25 cents to a dollar, in 5-cent increments): 45 You bought an item for 45 cents and gave me a dollar, so your change is 2 quarters, 0 dimes, and 1 nickel.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Fundamentals of Boolean Algebra and Digital Logics
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning