The coffee machine is not free anymore! One tea is 0,4 euro, a coffee is 0,6 euro, a chocolate is 0,5 euro.
The drink maker will now only make a drink if enough money is given for it.
- The drink maker should make the drinks only if the correct amount of money is given.
- If not enough money is provided, we want to send a message to the drink maker. The message should contains at least the amount of money missing.
The drink maker receives string commands from your code to make the drinks. It can also deliver info messages to the customer if ordered so. The instructions it receives follow this format:
"T:1:0" (Drink maker makes 1 tea with 1 sugar and a stick)
"H::" (Drink maker makes 1 chocolate with no sugar and therefore no stick)
"C:2:0" (Drink maker makes 1 coffee with 2 sugars and a stick)
"M:message-content" (Drink maker forwards any message received onto the coffee machine interface for the customer to see)
Important!
Remember that the drink maker forwards any message received onto the coffee machine interface for the customer to see.
If too much money is given, the drink maker will still make the drink according to the instructions. The machine will handle the return of the correct change. So do not worry about that.
You don't need to worry if there is too much money inserted. Just make sure, the minimum amount of money is set.
- Add a new function to the interface of the entry point:
void AddMoney(decimal amount)