0

I am looking for a way to write an algorithm to form teams based on roles, there should be an even distribution of roles within a team.

For example Let's say I have a group of 112 students, 28 Project Managers, 28 Marketeers, 28 Coders and 28 Designers. They should be formed into teams of 8 consisting of 2 Project Managers, 2 Marketeers, 2 Coders and 2 Designers.

How would I structure a class that randomly generate teams with an even distribution of roles? Any help would be greatly appreciated.

Regards, Al

  • 2
    What are you going to do with the leftover 16 people? – azurefrog Jun 07 '17 at 21:24
  • Just write a method with several arrays as an input and use something like `myArray[new Random().nextInt(myArray.length)];` on each array 2 times to form a team. – sorifiend Jun 08 '17 at 01:38
  • 1
    Possible duplicate of [How to randomly pick an element from an array](https://stackoverflow.com/questions/8065532/how-to-randomly-pick-an-element-from-an-array) – sorifiend Jun 08 '17 at 01:38
  • So what's the problem? What have you tried? You want us to code the situation? – Pushan Gupta Jun 08 '17 at 12:24
  • Hi Vidor. I am more looking for the method to go about doing this. I want to randomly generate teams with an even distribution of roles, I hope that makes sense. – clientSide Jun 08 '17 at 14:06

0 Answers0