question archive Base on the test
Subject:Computer SciencePrice: Bought3
Base on the test.java below draw an UML diagram and use pseudocode for algorithmspublic class Test {
static Scanner input= new Scanner(System.in);
public static void main(String[] args) throws IOException{
// public static void StudentInfo()
{
System.out.println("Student Name: Tai Wei-Te");
System.out.println("Student Id: 33382574");
System.out.println("CT Number: CT0266918");
System.out.println("Mode of Enrollment: ");
System.out.println("Tutor Name: Aaron Yeo");
System.out.println("Tutorial Attendance:");
System.out.println("--------------------------");
}
List<Student> students=null;
StudentRepository repository=new StudentRepository();
while(true) {
students=new ArrayList<Student>();
System.out.println("select choice: n-1 quit"
+ "n 1. all students"
+ "n 2. all course students"
+ "n 3. all research student"
+ "n 4. all students greater than average marks"
+ "n 5. student by id"
+ "n 6. sort student list"
+ "n 7 save sorted student list to file");
int choice=input.nextInt();
if(choice==-1) {
break;
}else if(choice==1){
students=repository.findAll();
}else if(choice==2){
students=repository.findAllCourse();
}else if(choice==3){
students=repository.findAllResearch();
}else if(choice==4){
students=repository.findAllGreaterThanAverage();
}else if(choice==5){
System.out.println("enter id");
int id=input.nextInt();
System.out.println(repository.findById(id));
}else if(choice ==6) {
students=repository.sort();
}else if(choice ==7) {
repository.save();
}
for(Student s: students) {
System.out.println(s);
}
}