Question: Write a program for a vending machine selling various type of drinks. Requirements: Declare and initialize both arrays- drink and price in main(). Include 3
Write a program for a vending machine selling various type of drinks. Requirements: Declare and initialize both arrays- drink and price in main(). Include 3 user defined functions in the program. o ShowMenu() Display the list of all drinks and the prices. o GetMoney() Ask user input amount of coin. Validate the input from user. Only coins such as 50 cent, 20 cent and 10 cent can be accepted. Let the user enter coins if he/she desired. User may end input coins by inserting -1. Return total coins entered to main(). o Purchase() will accepted total coins from main(),displayed available drinks and prices that can be purchase using that amount, ask the user selection of drink, amount of money to be paid and show balance.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
