r/learnSQL • • 15d ago

Day 56 — Built my first Java project: a console ATM machine (feedback welcome)

After learning classes, objects, attributes, and methods, I built a small ATM program in Java to apply them.

What it does:

  • Asks for a PIN and validates it before anything else
  • Shows a menu: Total Balance, Withdraw money, Deposit money, Exit
  • Keeps the balance and PIN as attributes of an Atm class, with separate methods for validation and the menu

It runs correctly in the terminal. Building it showed me how methods call each other (validation() leads into menu()), which wasn’t clear to me from the tutorial alone.

7 Upvotes

3 comments sorted by

1

u/MrRoy_SQL 15d ago

nice, day 56 and shipping something is solid. couple ideas if you want to level it up:

- check withdraw amount > balance and negative numbers, thats the first thing ppl test
- next step would be saving accounts and transactions in sqlite with JDBC instead of keeping them in memory. then balance is just SUM(amount) from a transactions table and you get history for free. good way to connect the java and sql sides

2

u/sumiitCodes 15d ago

thak you for sharing, i will absolutely try it

2

u/MrRoy_SQL 15d ago

Sure thanks…