-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDay28_prob1.java
More file actions
77 lines (61 loc) · 1.74 KB
/
Day28_prob1.java
File metadata and controls
77 lines (61 loc) · 1.74 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
/*
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.
Input Format
First line reads the number of accounts to be opened N
N times,
Read the Name of the Customer
read the character (A/ P)
read the Aadhar Number of PAN accordingly
Constraints
N>0
Output Format
Prints the Account Numbers in separate lines
Sample Input 0
2
Amit Dutta
P
DUAPS7896P
Sanjeev
A
512233213490
Sample Output 0
P101
A101
Sample Input 1
2
Md. Azharuddin
A
GHBRQ2718A
Surinder Singh
A
MPUPS3878D
Sample Output 1
A101
A102
*/
// kirtan jain
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) {
/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
Scanner sc = new Scanner(System.in);
int n = sc.nextInt(), counta=101, countp=101;
for(int i = 0;i<n;i++){
if(i==0){
String flush = sc.nextLine();
}
String name = sc.nextLine();
String z = sc.nextLine();
String id = sc.nextLine();
if(z.equals("A")){
System.out.println("A"+counta);
counta++;
}
if(z.equals("P")){
System.out.println("P"+countp);
countp++;
}
}
}
}