-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJ031.java
More file actions
34 lines (25 loc) · 797 Bytes
/
J031.java
File metadata and controls
34 lines (25 loc) · 797 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
import java.util.Scanner;
public class J031{
public static void main(String[] args){
J031 pStudio = new J031();
pStudio.J031();
}
public void J031(){
Scanner s = new Scanner(System.in);
String userid;
String password;
String name;
userid = s.nextLine();
password = s.nextLine();
name = s.nextLine();
if(password.length() < 3)
System.out.println("Error! password is too short,");
else
System.out.printf("User Id: %s\n",userid);
System.out.printf("Password: %s",password.substring(0,2));
for(int i = 2; i<password.length(); i++){
System.out.printf("*");
}
System.out.printf("\nUser Name: %s\n",name);
}
}