Here's a beginner-friendly Java problem that helps you practice basic concepts like variables, loops, conditionals, and methods:
Problem: Simple ATM Simulator
Write a Java program that simulates a basic ATM. The program should:
- Start with a balance of $1000.
- Show a menu with the following options: Check Balance Deposit Money Withdraw Money Exit
- Allow the user to choose an option using a number input.
- Perform the selected operation and repeat the menu until the user chooses to exit.
*Example:
Welcome to the ATM!
-
Check Balance
-
Deposit Money
-
Withdraw Money
-
Exit Enter choice: 2 Enter amount to deposit: 500 Deposit successful!
-
Check Balance
-
Deposit Money
-
Withdraw Money
-
Exit Enter choice: 1 Current Balance: $1500
- Clone the repo
- Open in your IDE (VS Code for example)
- Run the main class or unit tests
- Open Terminal in VS Code
- Run from the root app/src/main/java
- Run command javac q1/team1/*.java
- Run command java q1.team1.CartCLI (To initiate interactive Terminal)