-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUserMenu.java
More file actions
138 lines (106 loc) · 3.22 KB
/
UserMenu.java
File metadata and controls
138 lines (106 loc) · 3.22 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
import java.io.*;
import java.util.*;
class UserMenu extends Headertop
{
public static void menu()throws Exception
{
int n=0;
int choice;
String code,name,address,contact,category,hostel;
clearcls();
header();
head("USER MENU");
centeralign("Greetings Dear USER! Welcome!");
System.out.println();
System.out.println("1] KNOW ABOUT THE FIELD YOU LIKE");
System.out.println("2] VIEW ALL INSTITUTES");
System.out.println("3] SEARCH INSTITUTES");
System.out.println("4] EXIT");
do
{
System.out.println("\nPlease enter a valid choice:");
n=Integer.parseInt(Validate.enterInt());
}while(n>4 || n<=0);
switch(n)
{
case 1:
System.out.println("Enter code of Institute('ENG','MED','MNG','DES','LAW','JOU')");
code=Validate.enterCode();
System.out.println();
Information.info(code);
callagain();
break;
case 2:
System.out.println("Enter code of Institute('ENG','MED','MNG','DES','LAW','JOU')");
code=Validate.enterCode();
System.out.println();
View.readfile(code);
callagain();
break;
case 3:
centeralign("Enter code of Institute('ENG','MED','MNG','DES','LAW','JOU')");
code=Validate.enterCode();
View.readfile(code);
do
{
System.out.println("--------------------------------------------------------------------------------------------------------");
System.out.println("--------------------------------------------------------------------------------------------------------");
System.out.println("What would you like to Search by");
System.out.println("1] Name ");
System.out.println("2] Address ");
System.out.println("3] Contact ");
System.out.println("4] Category ");
System.out.println("5] Hostel Facility ");
System.out.println("6] Exit \n");
System.out.println("Enter your Choice");
choice=Integer.parseInt(enterInt()); //Validating for Integer
switch(choice)
{
case 1:
System.out.println("Enter Name");
name=enterString();
//Search by name
Search.searchfile(code,name);
break;
case 2:
System.out.println("Enter Address");
address=enterString();
//Search by address
Search.searchfile(code,address);
break;
case 3:
System.out.println("Enter Contact Number");
contact=enterContact();
//Search by Contact num.
Search.searchfile(code,contact);
break;
case 4:
System.out.println("Enter Category(National/International)");
category=enterCategory();
//Search by Category
Search.searchfile(code,category);
break;
case 5:
System.out.println("Enter Hostel Facility(Yes/No)");
hostel=enterHostel();
//Search by hostel facility
Search.searchfile(code,hostel);
break;
case 6:
Main_menu.menu_disp();
break;
default:
System.out.println("Please enter a valid choice");
}
}while(choice!=6);
System.out.println("--------------------------------------------------------------------------------------------------------");
break;
case 4:
exit();
break;
default:
System.out.println("Please enter a valid option");
break;
}
}
}