-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
48 lines (44 loc) · 1.57 KB
/
Copy pathMain.java
File metadata and controls
48 lines (44 loc) · 1.57 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
import java.sql.*;
import java.util.Scanner;
import frontend.agent;
import frontend.re_agent;
public class Main{
public static void main(String[] args) {
int trials=0,choice=0;
while (true) {
trials++;
if(trials>=5){
System.out.println("Connection lost too many times! Ending program");
break;
}
try {
Scanner sc=new Scanner(System.in);
while(true) {
System.out.println("Enter your user type");
System.out.print("Users are: \n1 real estate office\n2 agent\n3 exit\n");
choice = Integer.parseInt(sc.nextLine());
switch(choice){
case 1:
re_agent.main(null);
break;
case 2:
agent.main(null);
break;
case 3:
System.out.println("Exiting program");
break;
default:
System.out.print("Wrong choice! No Real Estate info for you\n");
choice=0;
}
if(choice!=0)
break;
}
sc.close();
break;
} catch (Exception e) {
System.out.println("Something happened!"+e);
}
}
}
}