Question
Files to submit: change.c Requriements: Program must compile with both -Wall and -Werror options enabled Submit only the files requested Use doubles to store real
Files to submit: change.c
Requriements:
Program must compile with both -Wall and -Werror options enabled
Submit only the files requested
Use doubles to store real numbers
Print all doubles to 2 decimal points unless stated otherwise
Problem Statement
You are working at a bank. People routinely come in to withdraw money from their accounts but always request that their money be given to them in the fewest number of bills possible. Write a program named change.c that asks the user how much money they would like to withdraw and then tells them how many of which bills they are to receive. You have bills in the following denominations: 1, 5, 10, 20, 50, and 100
Assumptions
All input is valid
The user will only ask for whole dollar ammounts (i.e. they won't ask for cents)
The examples provided do not represent all possible input you can receive
So make sure to test throughly on your machine
Examples
In the examples below user input has been underlined. You don't have to do any underlining in your program. It is just there to help you differentiate between what is input and what is output.
Example 1
Please enter the amount of money you wish to withdraw: 1589
You received 15 hundred(s)
You received 1 fifty(s)
You received 1 twenty(s)
You received 1 ten(s)
You received 1 five(s)
You received 4 one(s)
Example 2
Please enter the amount of money you wish to withdraw: 75
You received 0 hundred(s)
You received 1 fifty(s)
You received 1 twenty(s)
You received 0 ten(s)
You received 1 five(s)
You received 0 one(s)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started