feat: Set up project skeleton with stub implementations for student tasks
This commit is contained in:
+115
-1
@@ -1,8 +1,122 @@
|
||||
package dev;
|
||||
|
||||
import dev.service.StudentManager;
|
||||
import dev.thread.StudentLoader;
|
||||
import dev.utils.FileManager;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Scanner;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
|
||||
public static void main(
|
||||
String[] args)
|
||||
throws Exception {
|
||||
|
||||
Scanner scanner =
|
||||
new Scanner(System.in);
|
||||
|
||||
StudentManager manager =
|
||||
new StudentManager();
|
||||
|
||||
while (true) {
|
||||
|
||||
System.out.println("""
|
||||
1.Load students
|
||||
2.Search student
|
||||
3.Remove student
|
||||
4.Print students
|
||||
5.Exit
|
||||
""");
|
||||
|
||||
int choice =
|
||||
scanner.nextInt();
|
||||
|
||||
switch (choice) {
|
||||
|
||||
case 1 -> {
|
||||
|
||||
List<String> data =
|
||||
FileManager
|
||||
.loadStudents(
|
||||
"students.txt");
|
||||
|
||||
// TODO:
|
||||
|
||||
// Split data into 3 parts
|
||||
|
||||
List<String> part1 = null;
|
||||
|
||||
List<String> part2 = null;
|
||||
|
||||
List<String> part3 = null;
|
||||
|
||||
// TODO:
|
||||
|
||||
StudentLoader t1 =
|
||||
null;
|
||||
|
||||
StudentLoader t2 =
|
||||
null;
|
||||
|
||||
StudentLoader t3 =
|
||||
null;
|
||||
|
||||
// TODO:
|
||||
|
||||
// start()
|
||||
|
||||
// join()
|
||||
|
||||
// merge results
|
||||
|
||||
}
|
||||
|
||||
case 2 -> {
|
||||
|
||||
System.out.print(
|
||||
"ID: ");
|
||||
|
||||
int id =
|
||||
scanner.nextInt();
|
||||
|
||||
System.out.println(
|
||||
manager
|
||||
.searchStudent(
|
||||
id));
|
||||
|
||||
}
|
||||
|
||||
case 3 -> {
|
||||
|
||||
System.out.print(
|
||||
"ID: ");
|
||||
|
||||
int id =
|
||||
scanner.nextInt();
|
||||
|
||||
boolean removed =
|
||||
manager
|
||||
.removeStudent(
|
||||
id);
|
||||
|
||||
System.out.println(
|
||||
removed);
|
||||
|
||||
}
|
||||
|
||||
case 4 ->
|
||||
manager
|
||||
.printStudents();
|
||||
|
||||
case 5 -> {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user