0% found this document useful (0 votes)
8 views

Source Code

The document contains code for an ATM program that allows a user to insert their card, enter their PIN, select a service like withdraw or check balance, enter an amount, and check their current balance. The code includes if/else statements to validate the PIN and check if transactions exceed the balance.

Uploaded by

Pranav Sonvane
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Source Code

The document contains code for an ATM program that allows a user to insert their card, enter their PIN, select a service like withdraw or check balance, enter an amount, and check their current balance. The code includes if/else statements to validate the PIN and check if transactions exceed the balance.

Uploaded by

Pranav Sonvane
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

package PROJECT_ATM;

import java.sql.SQLOutput;
import java.util.*;

public class Project_1 {


// static String insert;
// static int accType;
// static int totalAmount = 20000;
static Scanner sc = new Scanner(System.in);
static int entAmount = sc.nextInt();

public static void main(String[] args) {


System.out.println(" WEL-COME TO BOM ");
System.out.println(" PLEASE INSERT YOUR CARD");
Scanner sc = new Scanner(System.in);
String insert = sc.nextLine();
if (insert.contentEquals("YES")) {
System.out.println(" PLEASE WAIT WHILE YOUR TRANSACTION IS
PROCESSING");
System.out.println("DO NOT REMOVE CARD");

} else {
System.out.println(" PLEASE TRY AGAIN");
System.out.println(" YOUR PIN IS WRONG");
}}
}/*
while ((insert.contentEquals("YES"))) {
System.out.println("***** SERVICES *****");
System.out.println("1. WITHDRAW");
System.out.println("2. BALANCE CHECK");
System.out.println("3. NEW USER");
System.out.println("4. FORGET PASSWORD");
System.out.println("**** *****");
break;
}
}

System.out.println(" please Wait");


System.out.println(" enter service num");
int accType = sc.nextInt();
if (accType == 1) {
String acc = "SAVING";
}
if (accType == 2) {
String acc = "CURRENT";

}
if (accType == 3) {
String acc = "Change password"

}
if (accType == 4) {
String acc = "new user";

}
}

IF (insert.equals("YES")){
System.out.println(" PLEASE WAIT WHILE YOUR TRANSACTION IS
PROCESSING");
System.out.println("DO NOT REMOVE CARD");}
int pin = sc.nextInt();
if(pin == 0000){
System.out.println(" PASSWORD IS ACCEPTED ");
}
else{
System.out.println(" PLEASE TRY AGAIN");
System.out.println(" YOUR PIN IS WRONG");

if (accType == 1) {
System.out.println(" enter amount for withdraw");
int entAmount = sc.nextInt();
if (entAmount > totalAmount) {
System.out.println(" INSUFFICIENT BALANCE");}

if (entAmount < totalAmount) {


System.out.println("*** PROCESSING***");
totalAmount = (totalAmount-entAmount);
System.out.println(entAmount+"AMOUNT HAS BEEN DEBITED FROM
YOUR ACCOUNT ******133");
System.out.println("YOUR CURRENT BALANCE IS");
System.out.println(totalAmount);
}

}
if (accType == 2) {
System.out.println(" enter amount for withdraw");
int entAmount = sc.nextInt();

if (entAmount < totalAmount) {


System.out.println(" INSUFFICIENT BALANCE");}

if (entAmount < totalAmount) {


System.out.println("*** PROCESSING***");
totalAmount = totalAmount - entAmount;
System.out.println(totalAmount);
}

}
if (accType == 1 && accType <= totalAmount) {
System.out.println(" enter amount for withdraw");
System.out.println(entAmount + "AMOUNT HAS BEEN DEBITED FROM YOUR
ACCOUNT ******133");
System.out.println("YOUR CURRENT BALANCE IS");
System.out.println(totalAmount);
}
if (accType == 1 && accType >= totalAmount) {
System.out.println(" INSUFFICIENT BALANCE");

}
if (accType == 2 && accType <= totalAmount) {
System.out.println(" enter amount for withdraw");
System.out.println(entAmount + "AMOUNT HAS BEEN DEBITED FROM YOUR
ACCOUNT ******133");
System.out.println("YOUR CURRENT BALANCE IS");
System.out.println(totalAmount);
}
if (accType == 2 && accType >= totalAmount) {
System.out.println(" INSUFFICIENT BALANCE")

}
}
}*/

You might also like