-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuestion7.java
More file actions
45 lines (39 loc) · 951 Bytes
/
Question7.java
File metadata and controls
45 lines (39 loc) · 951 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import java.util.*;
class DOB{
int date;
String month;
int year;
DOB(int date,String month,int year){
this.date=date;
this.month=month;
this.year=year;
}
}
public class Question7 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter name : ");
String name=sc.next();
System.out.println("Enter DOB");
DOB dob=new DOB(sc.nextInt(),sc.next(),sc.nextInt());
char p=name.charAt(0);
char s=name.charAt(1);
/*Satyam Sekhar Barik
* Regd-no : 2141002032
* sec : CSE-U
* */
char w=dob.month.charAt(0);
char d=dob.month.charAt(1);
StringBuilder password=new StringBuilder();
password.append(p);
password.append(s);
password.append(w);
password.append(d);
System.out.println("The generated password is :" +password);
sc.close();
}
}
/*Satyam Sekhar Barik
* Regd-no : 2141002032
* sec : CSE-U
* */