Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Building The Data Lakehouse

Authors: Bill Inmon ,Mary Levins ,Ranjeet Srivastava

1st Edition

1634629663, 978-1634629669

More Books

Students also viewed these Databases questions