-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBankAccount.java
More file actions
31 lines (27 loc) · 867 Bytes
/
BankAccount.java
File metadata and controls
31 lines (27 loc) · 867 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
package unit1;
import java.util.*;
public class BankAccount {
public static void main(String[] args) {
Account ac = new Account();
Scanner sc = new Scanner(System.in);
int accno;
String acctype;
float bal, wdamt, dptamt;
System.out.print("Enter acc number, acctype and balance : ");
accno = sc.nextInt();
acctype = sc.next();
bal = sc.nextFloat();
ac.setDetails(accno, acctype, bal);
System.out.println("Details of the account are ");
ac.putDeatils();
System.out.print("Enter amount to be withdrawn : ");
wdamt = sc.nextFloat();
ac.withDraw(wdamt);
System.out.println("Current balance of the account is : " + ac.getBalance());
System.out.print("Enter amount to be deposited : ");
dptamt = sc.nextFloat();
ac.deposit(dptamt);
System.out.println("Current balance of the account is : " + ac.getBalance());
sc.close();
}
}