-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoop(task_3).java
More file actions
133 lines (82 loc) · 2.2 KB
/
Copy pathoop(task_3).java
File metadata and controls
133 lines (82 loc) · 2.2 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
import java.util.Scanner;
class CustomerAccount{
private String CustomerName;
private String TypeOfAccount;
private int AccountNumber;
private String CurrentBalance;
private int debit;
private int credit;
public int number;
public int getDebit(){
return debit;
}
public void setDebit(int newDebit)
{
this.debit=newDebit;
}
public int getAccountNumber(){
return AccountNumber;
}
public void setAccountNumber(int newAccountNumber)
{
this.AccountNumber=newAccountNumber;
}
public int getCredit(){
return debit;
}
public void setCredit(int newCredit)
{
this.credit=newCredit;
}
public String getCustomerName(){
return CustomerName;
}
public void setCustomerName(String newCustomerName)
{
this.CustomerName = newCustomerName;
}
public static void main(String[] args) {
Scanner s=new Scanner(System.in);
System.out.println("enter account number");
int a =s.nextInt();
CustomerAccount c1 = new CustomerAccount();
CustomerAccount c2=new CustomerAccount();
CustomerAccount c3=new CustomerAccount();
c1.setCustomerName("James");
c1.setCredit(100);
c1.setDebit(100);
c1.setAccountNumber(1);
c2.setCustomerName("Jhonson");
c2.setCredit(200);
c2.setDebit(50);
c2.setAccountNumber(2);
c3.setCustomerName("usama");
c3.setCredit(1000);
c3.setDebit(550);
c3.setAccountNumber(3);
switch(a)
{
case 1:
System.out.printf("credit is %d \n",c1.getCredit());
System.out.printf("debit is :%d \n",c1.getDebit());
System.out.printf("Customer name is:%s \n",c1.getCustomerName());
break;
case 2:
System.out.printf("Customer name is:%s \n",c2.getCustomerName());
System.out.printf("credit is %d \n",c2.getCredit());
System.out.printf("debit is :%d \n",c2.getDebit());
break;
case 3:
System.out.printf("Customer name is:%s \n",c3.getCustomerName());
System.out.printf("credit is %d \n",c3.getCredit());
System.out.printf("debit is %d \n",c3.getDebit());
break;
default:
System.out.println("iNVALID ACCOUNT");
}
System.out.println("enter 1 for balance check \n enter 2 for withdraw \n enter 3 for deposit");
int b=s.nextInt();
System.out.println("enter amount to perform");
int amount =s.nextInt();
}
}