Title Enter number of groups and names of students. Press 0 to stop entering. names: entered names shuffled names: self-explanatory modulus o or x: self-explanatory quotient: number of names to push into each group Program is restarted automatically after. Updates from v1.0 1. now supports smart grouping mode. ex: dividing 19 people to 4 groups. result: 3 groups of 5 people and 1 group of 4 people. 2. automatic program reboot. Loader class Main class import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; public class Main { private Scanner sc; int groups; int quotient; ArrayList<String> students; ArrayList<ArrayList<String>> result; public Main() { this.main(); } public void main() { this.printTitle(); this.print("Press Enter to Continue..."); try { System.in.read(); } catch (IOException e) { e.printStackTrace(); } this.print("How many groups?"); ...
댓글
댓글 쓰기