-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainApp.java
More file actions
57 lines (48 loc) · 1.61 KB
/
MainApp.java
File metadata and controls
57 lines (48 loc) · 1.61 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package basicpwmanager;
import java.util.Scanner;
/**
*
* @author HD
*/
public class MainApp {
private static final String secret = "1";
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
System.out.println("====================="
+ " Luna Password Manager "
+ "===================\n");
System.out.print("Please input master password: ");
int counter = 3;
do {
String masterPass = Util.sc.next();
if (masterPass.equals(secret)) {
System.out.println("\nYou have successfully logged in...");
System.out.println("Welcome back!");
//TODO implement last time you were here
break;
} else {
counter--;
}
} while (counter > 0);
if (counter == 0) {
System.out.println("You have entered the incorrect password far too many times.");
} else {
// TODO call for security manager, initialise it, and decode the dictionary for faster search
MainApp.callForPrintMenu();
}
}
/**
* Calls for MenuManager.printMenu() while passing in the instantiated managers.
*/
public static void callForPrintMenu() {
RetrievalManager retrievalManager = new RetrievalManager();
MenuManager.printMenu(retrievalManager);
}
}