Skip to content

mohitgokul/University-Vending-Machine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

University-Vending-Machine

This is a Vending Machine that allows people to buy Products by entering the Item Code and 
inserting the money required for that Item

Lists of Items in the Vending Machine

Item Code Item Cost
A1 Cookie 100
A2 iPhone Charger 1500
C5 Potato Chips 200
D4 Chewing Gum 150

Approach

To program a VendingMachine you would need to write few methods which you will be using it In this Program I used the following methods

  1. ListMenu - For listing the Items and their Itemcode
  2. getItemPrice - For getting the price for each Items
  3. addMoney - For adding the money
  4. buy - For buying the product or item
  5. End - Finally press 4. to end the Program

And there are certain conditions which you need to use such as when

  • If you haven't added enough money for the Item then you need to add
  • And after each succesful vend you need to display "Vend Succesful"
  • And if you have added more money you should return back the Balance
  • If the item code isn't valid or isn't available you need to display - "Item Invalid"

Executing the Code

Here is the Link for Running the program https://repl.it/@mohitgokul/VendingMachine

About

Vending Machine that allows people to buy Products

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages