Lab 2 – Monetary value


Write an application that prompts for and reads a double value representing a monetary amount. Then determine the fewest number of each bill and coin needed to represent that amount, starting with the highest (assume that a ten-dollar bill is the maximum size needed). For example, if the value entered is 47.63 (forty-seven dollars and sixty-three cents), then the program should print the equivalent amount as:


4 ten dollar bills

1 five dollar bills

2 one dollar bills

2 quarters

1 dimes

0 nickels

3 pennies


Be sure to test your solution using a variety of different monetary amounts.