-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser.java
More file actions
42 lines (36 loc) · 1.36 KB
/
user.java
File metadata and controls
42 lines (36 loc) · 1.36 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
import java.util.Scanner;
public class user {
public static void main(String[] args) {
String userName,password;
Scanner sc = new Scanner(System.in);
System.out.println("Kullanici adi:");
userName = sc.nextLine();
System.out.println("Sifre:");
password = sc.nextLine();
if(userName.equals("user") && password.equals("java1234")){
System.out.println("giris basarili...");
}else{
System.out.println("sifreyi degismek istiyor musunuz?(Y/y veya N/n)");
String c;
c = sc.nextLine();
if(c.equals("y") || c.equals("Y")){
String newPassword;
System.out.println("Yeni sifre:");
newPassword = sc.nextLine();
while(true){
if(newPassword.equals("java1234") || newPassword.equals(password)){
System.out.println("Sifre olusturulamadi.lutfen baska sifre girin:");
newPassword = sc.nextLine();
}else{
password = newPassword;
System.out.println("sifre olusturuldu");
break;
}
}
}else{
System.out.println("sifre degistirilmedi.");
}
}
sc.close();
}
}