Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Generate a coin dispenser machine. This machine would dispense change for any appropriate monetary value. This value should be less than $ 1 0 0

Generate a coin dispenser machine. This machine would
dispense change for any appropriate monetary value. This value should be
less than $100. The machine uses an algorithm which dispenses the least
number of coins based on the US coin system of quarters, dimes, nickels,
and pennies.
As we talked about in class, $10.75 worth of coins would be 43 quarters
(minimum number of coins).
$10.74 worth of coins would dispense 42 quarters, 2 dimes, 4 pennies.
You can also use the Canadian coin system which includes 2-dollar (200
cents) and 1-dollar coins, just indicate at the begin of your program which
monetary system youre referring to. If you have any other monetary system
in mind, feel free to use it. The algorithm would not change and only the coin
names and values would be modified.
Instructions: Write a program that would prompt the user to input some value
in dollars and cents in the format of $xx.xx and solve the equivalent number
of coins. This number of coins can be at most $100.00.
For an input of $5.42 the machine dispenses the following:
-21 quarters
-1 dime
-1 nickel
-2 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

Learn Mysql The Easy Way A Beginner Friendly Guide

Authors: Kiet Huynh

1st Edition

B0CNY7143T, 979-8869761545

More Books

Students also viewed these Databases questions

Question

2. What are your challenges in the creative process?

Answered: 1 week ago