-
Notifications
You must be signed in to change notification settings - Fork 5
/
Customer.java
54 lines (46 loc) · 1021 Bytes
/
Customer.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
48
49
50
51
52
53
54
package com.main;
/*
@author:Akash Tiwari
*/
import java.util.Scanner;
import com.pro.A;
import com.pro.B;
public class Customer {
private String name;
private double balance;
private double amount;
B b=new B();
A a=new A();
public Customer(String name, double d) {
super();
this.name = name;
this.balance = d;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getBalance() {
return balance;
}
public void setBalance(double balance) {
this.balance = balance;
}
void deposit() {
System.out.println("Enter the amount to deposit");
Scanner sc=new Scanner(System.in);
this.amount=sc.nextInt();
balance=balance+amount;
a.update();
sc.close();
}
void withdraw() {
System.out.println("Enter the amount to withdraw");
Scanner sc=new Scanner(System.in);
this.amount=sc.nextInt();
B b=new B();
sc.close();
}
}