-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChangePin.java
52 lines (46 loc) · 1.76 KB
/
ChangePin.java
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
import java.util.*;
public class ChangePin extends PIN_Change{
Scanner sc = new Scanner(System.in);
HomeScreen hs;
String newPIN, dummyPin;
public void ChangePIN(){
System.out.println("Please enter your current PIN:");
dummyPin = sc.nextLine();
try{
Thread.sleep(3000);
}
catch(InterruptedException e){
System.err.println("Oops! Something went wrong. Please try again later!" + e.getMessage());
}
if(dummyPin.equals(BalanceEnquiry.PIN)){
System.out.println("Please enter your new PIN to proceed:");
newPIN = sc.nextLine();
BalanceEnquiry.PIN = newPIN;
System.out.println("Please re-enter your new PIN to confirm:");
String dummyPin2 = sc.nextLine();
if(dummyPin2.equals(BalanceEnquiry.PIN)){
System.out.println("Thank you! Your PIN has now been updated.\nPlease wait a few seconds.....");
}
else{
System.out.println("Incorrect PIN entered! Please try again later");
try{
Thread.sleep(3000);
}
catch(InterruptedException e){
System.err.println("Oops! Something went wrong. Please try again later!" + e.getMessage());
}
hs.home_page_display();
}
try{
Thread.sleep(3000);
}
catch(InterruptedException e){
System.err.println("Oops! Something went wrong. Please try again later!" + e.getMessage());
}
}
else{
System.out.println("Incorrect PIN entered! Please try again later.");
hs.home_page_display();
}
}
}