ATM Simulation System Using Java With Source Code

Introduction:
Thanks for visiting the ATM Stimulation System! This Command-Line User Interface (CLI)-based ATM Stimulation System offers a clear and easy way to execute withdrawals, deposits, and check balances. Java is the programming language used to create it. The system includes a simple command line interface with a switch case for executing deposits, withdrawals, and balance checks. It also updates the current balance after each operation. Anyone who needs to quickly calculate deposits and withdrawals should use this system. So, sit back, make a cup of coffee, and start calculating the amount in the ATM Stimulation System.
Explanation:
This Command-Line User Interface (CLI)-based ATM Stimulation System offers a clear and easy way to execute withdrawals, deposits, and check balances. The system includes a simple command line interface with a switch case for executing deposits, withdrawals, and balance checks. It also updates the current balance after each operation.
Source Code:
Get Discount on Top Educational Courses
import java.util.Scanner;
public class ATM {
public static void main(String args[]) {
// declare and initialize balance, withdraw, and deposit
int balance = 5000, withdraw, deposit;
// create scanner class object to get choice of user
Scanner sc = new Scanner(System.in);
while (true) {
System.out.println("**Automated Teller Machine**");
System.out.println("1. Withdraw");
System.out.println("2. Deposit");
System.out.println("3. Check Balance");
System.out.println("4. EXIT");
System.out.print("Choose the operation you want to perform:");
// get choice from user
int choice = sc.nextInt();
switch (choice) {
case 1:
System.out.print("Enter money to be withdrawn:");
// get the withdrawl money from user
withdraw = sc.nextInt();
// check whether the balance is greater than or equal to the withdrawal amount
if (balance >= withdraw) {
// remove the withdrawl amount from the total balance
balance = balance - withdraw;
System.out.println("Please collect your money");
} else {
// show custom error message
System.out.println("Insufficient Balance");
}
System.out.println("");
break;
case 2:
System.out.print("Enter money to be deposited:");
// get deposite amount from te user
deposit = sc.nextInt();
// add the deposit amount to the total balanace
balance = balance + deposit;
System.out.println("Your Money has been successfully depsited");
System.out.println("");
break;
case 3:
// displaying the total balance of the user
System.out.println("Balance : " + balance);
System.out.println("");
break;
case 4:
// exit from the menu
System.exit(0);
default:
//default statement
System.out.println("Invalid Choice");
}
}
}
}
This system is built using Switch Case, while loop, and Scanner class. The system will first display the user’s available options. Withdraw, Deposit, Check Balance, and EXIT are available as choices. The user must choose a useful choice. The operation will be carried out as per the input choice, and the balance will be updated following each operation. The user could also get balance information in the “Check Balance” option.
Output:

Find More Projects
URL Shortener Using Python Django Introduction: Long URLs can be shortened into short, shareable links with the help of the URL Shortener …
User Authentication System Using Python Django Introduction: The implementation of safe and adaptable user authentication in Django is the main goal of …
The E-Learning System using Java with a Graphical User Interface (GUI) Introduction The E-Learning System is developed using Java (with a Graphical …
Weather App Using Python Django Introduction: When a user enters the name of a city, the Weather App retrieves current weather information. …
Quiz App Using Python Django Introduction: Users can take quizzes in a variety of subjects, see their results, and monitor their progress …
resume screener in python using python introduction The hiring process often begins with reviewing numerous resumes to filter out the most suitable …