-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBankAccount.java
47 lines (40 loc) · 1.11 KB
/
BankAccount.java
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
47
class BankAccount
{
public String accountName;
public int accountNo;
public int deposite;
public int withdraw;
public double balance;
public void newaccount(String accountName, int accountNo)
{
this.accountName = accountName;
this.accountNo = accountNo;
}
public void deposite(int balance, int deposite)
{
this.balance = balance;
this.deposite = deposite;
this.balance = this.balance + deposite;
}
public void withdraw(int withdraw)
{
this.withdraw = withdraw;
this.balance = this.balance - withdraw;
}
public void viewbalance()
{
System.out.println("Account Holder Name :" + this.accountName);
System.out.println("New Account Number :" + this.accountNo);
System.out.println("Account Deposite Money :"+ this.deposite);
System.out.println("Account WithDraw Money :" + this.withdraw);
System.out.println("Account Total Balance :" + this.balance);
}
public static void main(String args[])
{
BankAccount bankaccount = new BankAccount();
bankaccount.newaccount("Darshan Mistari",101);
bankaccount.deposite(5000,2000);
bankaccount.withdraw(1000);
bankaccount.viewbalance();
}
}