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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!