forked from DomTheDeveloper/CSE231-ClassProject
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDisplay.java
More file actions
198 lines (171 loc) · 5.16 KB
/
Display.java
File metadata and controls
198 lines (171 loc) · 5.16 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
package edu.oakland.production.ClassProject;
package cse231;
import java.util.*;
/**
*
* @author Display Group
* @version 1.0 The start
* @since 3/24/2015
*/
public class Display
{
/**
* Constructor
*/
public Display(){
}
Middleware middleware = new Middleware();
public void BinaryTree(){
long start_time = 0;
long end_time = 0;
Scanner scan = new Scanner(System.in);
while(true){
System.out.println("Choose the number of elements.");
System.out.println("1. 100k Elements (A)");
System.out.println("2. 200k Elements (B)");
System.out.println("3. 400k Elements (C)");
System.out.print(">");
String response = scan.next();
switch(response)
{
case "A":
start_time = System.currentTimeMillis();
//Call some method
end_time = System.currentTimeMillis();
System.out.println("100k element created");
break;
case "B":
start_time = System.currentTimeMillis();
//Call some method
end_time = System.currentTimeMillis();
System.out.println("200k element created");
break;
case "C":
start_time = System.currentTimeMillis();
//Call some method
end_time = System.currentTimeMillis();
System.out.println("400k element created");
break;
case "D":
break;
}
System.out.println("Binary search took : "+ (end_time - start_time)+ " ms");
System.out.println("Would you like to do another search? (y/n)");
response = scan.next();
if ("y".equals(response))
{
//Run again
}
else
{
break;
}
}
scan.close();
}
public void HashTable(){
final Scanner sc = new Scanner(System.in);
do{
System.out.println("Choose Number of Elements: ");
System.out.println("A: 100,000 Elements");
System.out.println("B: 200,000 Elements");
System.out.println("C: 400,000 Elements");
try {
String choice = sc.nextLine();
if (choice.equals("A") || choice.equals("a")){
//Call Method with 100,000 elements
System.out.println("You have selected 100,000 elements");
break;
}
else if (choice.equals("B") || choice.equals("b")){
//Call Method with 200,000 elements
System.out.println("You have selected 200,000 elements");
break;
}
else if (choice.equals("C") || choice.equals("c")){
//Call Method with 400,000 elements
System.out.println("You have selected 400,000 elements");
break;
}
else {
System.out.println("Invalid Input. Try Again.");
}
} catch(final InputMismatchException e) {
System.out.println("Invalid Input. Try again.");
}
} while(true);
sc.close();
}
public void SchedulingClass(){
boolean isClassMade = false;
boolean stayIn = true;
Scanner scan = new Scanner(System.in);
do {
System.out.println("Select an option");
System.out.println("1.) Input student data into class. Enter A");
System.out.println("2.) Cut Last 5 students Enter B");
System.out.println("3.) Process Scholarships Enter C");
System.out.println("4.) Reinstate Students to class Enter D");
System.out.println("5.) Exit Enter E" );
System.out.print(">");
String response = scan.next();
String temp = "";
if ("E".equals(response)){
stayIn = false;
}
else if (!"A".equals(response) && isClassMade == false){
System.out.println("Class has not been made yet. Do you want to make the class? (y/n)");
response = scan.next();
if ("y".equals(response))
{
temp = middleware.CreateClass();
isClassMade = true;
}
}
else{
switch(response)
{
case "A":
if (isClassMade){
System.out.println("Class already was made, do you want to enter new data? (y/n)");
if ("y".equals(response))
{
//CLEAR
temp = middleware.CreateClass();
isClassMade = true;
}
}
else{
temp = middleware.CreateClass();
System.out.println("Class Made");
isClassMade = true;
}
break;
case "B":
temp = middleware.CutClass();
System.out.println("Cut Class");
break;
case "C":
temp = middleware.Scholarship();
System.out.println("Scholar");
break;
case "D":
temp = middleware.ResetClass();
System.out.println("Reset Class");
break;
}
System.out.println("Would you like to do continue in the class edit menu? (y/n)");
response = scan.next();
if ("y".equals(response))
{
//Run again
}
else
{
stayIn = false;
}
}
}while(stayIn);
scan.close();
}
}