-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUltraFastCash.java
64 lines (51 loc) · 2.18 KB
/
UltraFastCash.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
53
54
55
56
57
58
59
60
61
62
63
64
import java.util.*;
public class UltraFastCash extends CashWithdrawl {
Scanner sc = new Scanner(System.in);
HomeScreen hs;
float amount;
String dummyPin;
public void withdrawCash(){
System.out.println("Please enter your PIN to proceed:");
dummyPin = sc.nextLine();
if(dummyPin.equals(BalanceEnquiry.PIN)){
System.out.println("Please enter the amount you would like to withdraw: (only 500/1000/2000/5000)");
amount = sc.nextFloat();
while(amount % 500 == 0 && amount <= 5000){
BalanceEnquiry.balance -= amount;
break;
}
System.out.println("Would you like to view your balance?");
String response = sc.nextLine();
if(response.equalsIgnoreCase("Y")){
System.out.println("Account Balance: " + BalanceEnquiry.balance);
try{
Thread.sleep(3000);
}
catch(InterruptedException e){
System.err.println("Oops! Something went wrong. Please try again later!" + e.getMessage());
}
hs.home_page_display();
}
else{
System.out.println("Thank you for using Axis Bank Services! Please wait....");
try{
Thread.sleep(3000);
}
catch(InterruptedException e){
System.err.println("Oops! Something went wrong. Please try again later!" + e.getMessage());
}
hs.home_page_display();
}
}
else{
System.out.println("Wrong PIN entered! Please try again.");
try{
Thread.sleep(3000);
}
catch(InterruptedException e){
System.err.println("Oops! Something went wrong. Please try again later!" + e.getMessage());
}
hs.home_page_display();
}
}
}