[Previous Homework] [Next Homework]

hw15 - Exact Change


Develop an interactive application in which the user enters a cost of an item less than $20 and pays for it with a $20 bill. The program will figure out the exact change due using the least amount of each type of bill or coin. Program will display the number of each type of bill, quarters, dimes, nickels, pennies needed.

  • Before you start coding, design and pseudocode your problem
    • Create a new file called makechange.txt
    • At the top, list the basic functions the program will have to perform
      • Hint: There should be several.
    • For main() and each of your functions, write appropriate pseudocode

  • Develope your code in makechange.c to implement the pseudocode.
    • Use a structure to store the number of all the various bills / coins that will be returned to the user.

From Linux on the GL machine:
  • Compile the program:
    gcc -o makechange makechange.c

  • Run the program to make sure it works:
    ./makechange

  • Use the SUBMIT utility turn in the homework.
    submit cs104_grasso hw15 makechange.c makechange


Reference Programs :



Make sure that you follow all the coding standards