-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBank.java.bak
More file actions
46 lines (45 loc) · 907 Bytes
/
Bank.java.bak
File metadata and controls
46 lines (45 loc) · 907 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
class Account // Creating class
{
int accno;// initialize instance variable
String name;
float amt;
void insert(int a, String n, float am)// method creation insert
{
accno=a;
name=n;
amt=am;
System.out.println(accno+" "+name+" "+am);
}
void deposit(float am)// method creation deposite
{
amt=amt+am;
System.out.println("Amount Deposited RS. "+am);
}
void withdraw (float am)// method creation withdraw
{
if (amt<am)
{
System.out.println("Insufficent Balance");
}
else
{
amt=amt-am;
System.out.println(am +" Withdrawl from your Account");
}
}
void balance()// method creating balance
{
System.out.println("Your Account Balance is Rs. "+amt);
}
}
class Bank
{
public static void main(String[] args)
{
Account a = new Account();
a.insert(7084508, "ANSHU JEE", 1000);
a.deposit(25000);
a.withdraw(55000);
a.balance();
}
}