Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please help. language is C not C++ 1 1 2 100% + Vending machines: Below is the list of drink available and the prices. Drink
please help. language is C not C++
1 1 2 100% + Vending machines: Below is the list of drink available and the prices. Drink Prices Mineral water RM1.00 Coca-cola RM2.50 Seven-UP RM2.20 Nescafe RM3.00 SoyDrink RM1.90 Write a program for a vending machine selling various type of drinks. Requirements: O 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. You are NOT allowed to use any global variable in this program. In the case of COPYING/PLAGIARISM, you will be given zero markStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started