assign1 - Programming and Data Structures Assignment 1...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Programming and Data Structures Assignment 1 Change Machine Write a program to simulate a change dispensing machine. Such a machine automatically dispenses a given amount of money in change when instructed by an operator. The change machine has a finite amount of coins and notes of each denomination stored separately within it. Your program should work as follows: Given the amount of change that needs to be dispensed, the program should print instructions for giving out coins and notes from the machine’s coins and notes store so as to dispense the change using the smallest number of coins and notes necessary. If the change cannot be dispensed for any reason, (e.g. the machine does not have enough change or is empty) the program should simply print a statement to that effect. No coin dispensing instructions should be printed. However, if it is possible to give change then it should print out directions for giving out the change neatly. For example, if the change was £6.34, the machine should print out something like this:
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.
Ask a homework question - tutors are online