You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Jalandhar Public Bank has recently launched the Provident Fund Scheme and the CEO of the bank is looking for a java program to create a Provident Fund object such that customer should be allowed to open the account by providing any one of the id proofs Aadhar (long) or PAN (String) along with Full Name. It is also expected that the unique account number is assigned to the Customer in a serial order starting from A101 for Aadhar Card holders and P101 for PAN holders.
3
+
4
+
Input Format
5
+
6
+
First line reads the number of accounts to be opened N
7
+
N times,
8
+
Read the Name of the Customer
9
+
read the character (A/ P)
10
+
read the Aadhar Number of PAN accordingly
11
+
12
+
Constraints
13
+
14
+
N>0
15
+
16
+
Output Format
17
+
18
+
Prints the Account Numbers in separate lines
19
+
20
+
Sample Input 0
21
+
22
+
2
23
+
Amit Dutta
24
+
P
25
+
DUAPS7896P
26
+
Sanjeev
27
+
A
28
+
512233213490
29
+
Sample Output 0
30
+
31
+
P101
32
+
A101
33
+
Sample Input 1
34
+
35
+
2
36
+
Md. Azharuddin
37
+
A
38
+
GHBRQ2718A
39
+
Surinder Singh
40
+
A
41
+
MPUPS3878D
42
+
Sample Output 1
43
+
44
+
A101
45
+
A102
46
+
*/
47
+
48
+
importjava.io.*;
49
+
importjava.util.*;
50
+
51
+
classJPB
52
+
{
53
+
54
+
Stringname;
55
+
StringPAN;
56
+
StringAadhar;
57
+
StringCN;
58
+
staticintACN = 101;
59
+
staticintPCN = 101;
60
+
JPB(Stringname)
61
+
{
62
+
this.name = name;
63
+
}
64
+
voidgetOpenA(StringA)
65
+
{
66
+
Aadhar = A;
67
+
CN = "A"+Integer.toString(ACN++);
68
+
}
69
+
voidgetOpenP(StringP)
70
+
{
71
+
PAN = P;
72
+
CN = "P"+Integer.toString(PCN++);
73
+
}
74
+
75
+
76
+
}
77
+
publicclassSolution {
78
+
79
+
publicstaticvoidmain(String[] args) {
80
+
/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
0 commit comments