Vending Machine
Inside the Terminal
A vending machine that runs entirely in the terminal. I wrote it in Bash. The script fills the stock with random amounts. You pick a drink, pay with cash, TWINT or PayPal and get the correct change back.
Requirements
We had to write a Bash script that uses functions, loops, user input and conditions. If you typed something wrong, the program had to ask again and keep running.
What I Took Away
- Splitting code into Bash functions
- Checking input and catching wrong entries
- Random numbers for the stock
- Three payment options: cash, TWINT and PayPal
- Error handling in shell scripts
Project details
Period2025
SchoolIMS-T Switzerland
TypeSchool Project
StatusCompleted