ATM ppt2

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 11

TOPIC: AUTOMATED TELLER MACHINE

(ATM)
TEAM MEMBERS:
A.VARUN KUMAR(23EG505R03)
CH.HRUSHIKESH(23EG505R10)
N.HARSHITH(23EG505R29)
S.TEJESH KUMAR(23EG505R36)
A.JASHWANTH(23EG505R46)
Abstract

This presentation introduces a Java program that simulates the basic functions
of an ATM (Automated Teller Machine). Users can check their balance,
withdraw funds, deposit funds, and exit the system. We'll explore how the
program works, step-by-step, with code examples .

We'll discuss key programming concept like java.util package, showing how
they make the program easier to understand and use. The presentation
includes a live demonstration of the program running in a Java environment, so
you can see it in action.

Join us to learn about programming in Java and how it applies to real-world


scenarios like banking!
Introduction to ATMs
-
ATM stands for Automated Teller Machine and
is a convenient electronic banking device.
-

ATMs allow customers to perform various


banking transactions without visiting a physical
bank branch.
-

These machines are available 24/7, providing


easy access to cash withdrawals, deposits,
transfers, and more.
How ATMs Work
-
ATMs are connected to a bank's computer
network, allowing real-time processing of
transactions.
-

Customers use a debit or credit card and a


personal identification number (PIN) to access
their accounts securely.
-

ATMs communicate with the bank's core


banking system to verify account balances and
complete transactions.
Java.util package:
Scanner
It is used for obtaining the input of the primitive types like int, double, etc.
and strings.Scanner class helps to take the standard input stream in Java
and we need some methods to extract data from the stream.
Methods

nextInt() : Used for reading Int value.


nextFloat() : Used for reading Float value.
nextBoolean() : Used for reading Boolean value.
nextDouble() : Used for reading Double value.
nextByte() : Used for reading Byte value.
import java.util.Scanner;

public class Main {


public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
double balance = 1000;

while(true) {
System.out.println("1. Check Balance");
System.out.println("2. Withdraw");
System.out.println("3. Deposit");
System.out.println("4. Exit");
System.out.print("Enter your choice: ");
int choice = scanner.nextInt();
switch(choice) {
case 1:
System.out.println("Your balance is: $" + balance);
break;
case 2:
System.out.print("Enter amount to withdraw: ");
double withdrawAmount = scanner.nextDouble();
if(withdrawAmount > balance) {
System.out.println("Insufficient balance!");
} else {
balance -= withdrawAmount;
System.out.println("Withdrawal successful. Remaining
balance: $" + balance);
}
break;
case 3:
System.out.print("Enter amount to deposit: ");
double depositAmount = scanner.nextDouble();
balance += depositAmount;
System.out.println("Deposit successful. New balance: $" +
balance);
break;
case 4:
System.out.println("Exiting... Thank you!");
return;
default:
System.out.println("Invalid choice!");
}
}
}
}
OUTPUTS:
THANK YOU

You might also like