Question
Design a GUI front end for the Random Group Generator that replaces the input from the console. This should be in a completely different Java
Design a GUI front end for the Random Group Generator that replaces the input from the console. This should be in a completely different Java class than the class that performs the algorithm/processing to split the students into groups. Submit all java classes necessary to compile and build as well as your .css file. Use only the default packages. Follow coding standards. Name the class that contains main, and starts the application RandomGroupGeneratorGUI.java
import java.util.Scanner; import java.util.ArrayList; import java.util.Collections;
public class RandomGenerator { public static void main(String[] args) { ArrayList list = new ArrayList();
//Enter#Groups Scanner input1 = new Scanner(System.in); System.out.print("Enter the number of groups: "); int num = input1.nextInt();
//EnterStudentNames String name; Scanner input2 = new Scanner(System.in); do { System.out.print("Enter the Student name (or x to exit): "); name = input2.nextLine();
if(!name.equalsIgnoreCase("x")) { list.add(name); }
}while(!name.equalsIgnoreCase("x"));
System.out.println(list);
Collections.shuffle(list);
ArrayList> Air = new ArrayList<>();
for (int i = 0; i < num; i++) { ArrayList teams = new ArrayList(); Air.add(teams); }
for(int i = 0; i < list.size();i++) { int teamIndex = i % num; Air.get(teamIndex).add(list.get(i)); }
System.out.println(Air);
}
}
what more information is needed
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started