Answered step by step
Verified Expert Solution
Link Copied!

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++image text in transcribed

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 mark

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced MySQL 8 Discover The Full Potential Of MySQL And Ensure High Performance Of Your Database

Authors: Eric Vanier ,Birju Shah ,Tejaswi Malepati

1st Edition

1788834445, 978-1788834445

More Books

Students also viewed these Databases questions

Question

1. Discuss the potential legal issues that relate to training.

Answered: 1 week ago

Question

3. Design a program for preparing for cross-cultural assignments.

Answered: 1 week ago

Question

2. Develop a program for effectively managing diversity.

Answered: 1 week ago