0% found this document useful (0 votes)
4 views2 pages

Withdraw Program

Java withdraw program for Developing Atm Code

Uploaded by

Deepak Reddy
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)
4 views2 pages

Withdraw Program

Java withdraw program for Developing Atm Code

Uploaded by

Deepak Reddy
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

import [Link].

Scanner;
class ATM
{
private int accno;
private String name;
private float balance;
void SetAccount(int accno,String name,float balance)
{
[Link]=accno;
[Link]=name;
[Link]=balance;
}
void deposit(float transactionamount)
{
balance=balance+transactionamount;
}
float getBalance()
{
return balance;
}
void withdraw(float cash)
{
balance=balance-cash;
}
void print()
{
[Link](" account number");


[Link](accno);
[Link](" name of account holder");
[Link](name);
[Link](" amount");
[Link](balance);
}
}
class bank
{
public static void main(String []args)
{
Scanner s=new Scanner([Link]);
[Link]("enter account number");
ATM acc1= new ATM();
int accno=[Link]();
[Link]("enter name of account holder");
String name=[Link]();
[Link]("enter amount");
float balance=[Link]();
[Link](accno,name,balance);
[Link]();
[Link]("enter amount to be deposited");
float transactionamount=[Link]();
[Link](transactionamount);
[Link]([Link]());
[Link]("enter password");
float password=[Link]();
if(password==123)
{
[Link]("enter amount to be withdrawn");
float cash=[Link]();
[Link](cash);
[Link]([Link]());
}
else
{
[Link]("incorrect password");
}
}
}

You might also like