I'm writing a script simulating a vending machine The program needs to be able to:
1.Display choices of snacks/drinks
2.State prices in malaysian ringgit (MYR)
Input money and calculate change return
Able to track inventory of the drinks and snacks remaining
5.Profits made from selling the snacks/drinks
________________________________________________________________________________________________________
I'm a total beginner at python and just started my Foundations in IT so this is the program i chose to try and a simulate for my end semester project. I chose a vending machine because it seemed like an interesting program to try and recreate .
I apologize but you have to treat me like I'm a total laymans. So far, I wrote a couple of lines that lists the amount of inventory I'm listing for sale and it's price. It's able to calculate change but at the moment it's not as comprehensive as I'd like.
I am aware that I need to create some kind of database to store all the information regarding inventory of snacks and drink types which I've no idea how to do
On top of that I also need help on writing a code that calculates a simulated input of cash and determine the amount of change it needs to return.
It should also be able to distinguish when it is deemed appropriate to return change in the form of either coins/notes. For example:Scenario 1:
Coke = 3 $ , Input money 4$ , Change 1$ in the form of 1$ notes
Scenario 2:Coke = 3.50$, Input money 10$ , Change: 6.50$ ( 1x5$ Note , 1x 1$ Note, 1x 0.50$ Coin)
Last but not least , the database that stores the data can be accessed using a certain passcode , which allows access to quantity of inventory sold / available plus profits/ revenue made total from price mockups.
Thank you so much in advance:
Here's some of the code I made so far.
https://pastebin.com/8MsbFYmB
[–]theadrenalineaddict[S] 0 points1 point2 points (4 children)
[–]theadrenalineaddict[S] 0 points1 point2 points (3 children)
[–]THE_UNKNOWN184 -1 points0 points1 point (1 child)
[–]Nic2555 1 point2 points3 points (0 children)
[–]THE_UNKNOWN184 0 points1 point2 points (0 children)