-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate.java
More file actions
37 lines (27 loc) · 1.03 KB
/
create.java
File metadata and controls
37 lines (27 loc) · 1.03 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
import java.util.Scanner;
public class MobileBankingLogin {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("=== Welcome to WAP Mobile Banking ===");
System.out.print("Enter your username: ");
String username = scanner.nextLine();
System.out.print("Enter your PIN: ");
String pin = scanner.nextLine();
if (authenticate(username, pin)) {
System.out.println("Login successful! Accessing your account...");
\
showMenu();
} else {
System.out.println("Login failed! Invalid credentials.");
}
scanner.close();
}
private static boolean authenticate(String username, String pin) {
return username.equals("user123") && pin.equals("1234");
}
private static void showMenu() {
System.out.println("1. Check Balance");
System.out.println("2. Transfer Funds");
System.out.println("3. Logout");
}
}