The vending machine dispenses:
The program is to show the products sold by the vending machine, give directions on how to select a product and how to terminate.
When a product is selected, the user enters the amount coin-by-coin.
When the program terminates, the amount left in the machine is to be
displayed.
Your program must contain:
As you read this assignment you should have lots of questions that are not answered by this web page. This is intentional so that you encounter places where you must make design decisions. After part two's due date, more details will be provided.
Design the program by creating an outline or flowchart. Problem decomposition will result in a list of the main pieces of the solution. Describe how data flows from one piece to the next.
You are to write two specifications and your partner is to write the other two specifications. The specifications must include:
You are to work together writing the code for a single function and a
main function to test it.
This single function is the function that collects the money input by the user.
Two members should next be assigned different functions to write: calculate
change, and determine cost of purchase.
The third member is to write a test harness for each of these functions.
So, three separate programs
will be handed in. Each program will contain ONE of the functions and
the test harness (i.e., main).