Looking for a similar answer, essay, or assessment help services?

Simply fill out the order form with your paper’s instructions in a few easy steps. This quick process ensures you’ll be matched with an expert writer who
Can meet your papers' specific grading rubric needs. Find the best write my essay assistance for your assignments- Affordable, plagiarism-free, and on time!

Posted: April 17th, 2020

Randomness and Array Manipulation

Question description

Question 1 - Randomness and array manipulationsYou are a promising junior programmer in a video game business. You are part of a team working on an online gaming system for a first-person shooter game. In the game, players can register to an arena to play together. Sometimes, they play solo; sometimes, they play in teams.A1_Q1.pdeYou have been asked to implement a set of functionalities in Processing (!) to be able to shuffle and make subgroups of players to play in teams.Each player is identified by its username (a String object).Start from this code: A1_Q1_Source.zip. The sketch declares empty methods that you need to implement (called "stubs"). It also contains a list of usernames on which it performs a series of tests. You can see the correct expected result of these tests here. If your functions are implemented correctly, you should get similar results. Note that the results of the last test may slightly vary since it involves randomness.A1_Q1.pde1a - Randomize listImplement the following method without using ArrayList (ie. using only arrays)./** * This method takes a list of usernames and randomizes it. * @param userNames the list of usernames * @return a new array containing the randomized list of usernames */String[] createShuffledList(String[] userNames) {}Important:There should be no repetitions in the usernames (unless there was a username twice in the list sent as a parameter).The returned list should contain all and only the items from the original list. This means that it will have the same length (among other things).The list of usernames sent as a parameter should not be modified (ie. be aware that you are passing by reference).1b - GroupingImplement the following method without using ArrayList (ie. using only arrays)./** * This method takes a list of usernames and separates them in different groups. * @param userNames the list of usernames * @param nGroups the number of groups * @return an array of groups of usernames */String[][] createGroups(String[] userNames, int nGroups) {}Example:String[] userNames = loadStrings("usernames.txt"); // you can define your own file with usernames for testing purposesStringp[][] groups = createGroups(list, 3);will return an array "groups" where groups[i][j] contains the j-th username of the i-th group. Another way to say it is that groups[i] is an array of String (ie. String[]) containing the usernames of its group.Important:If nGroups is smaller than 1, it should be considered equal to 1 (ie. one group with everyone in it).if nGroups is larger than the number of usernames in the list, it should be considered equal to the number of usernames (ie. one person per "group").If the list has length 0 or is null, the method should return null.The returned array length is equal to the number of groups ie. groups.length == nGroups.There should be no repetitions of usernames anywhere in the returned array and all usernames should be there.When the number of usernames sent as a parameter cannot be perfecly divided by nGroups, you will have to return a mix of groups of different sizes. When that happens:You need to make sure that the difference in size between two groups does not exceed 1. For example, if you call createGroups(list, 3), the result should be an array of groups where each group contains either 2 or 3 usernames.The bigger groups should be at the beginning of the returned array; the smaller groups at the end.Groups are formed sequentially, in the order of the elements found in userNames. So for instance, userNames[0] should appear in the first group and userNames[length-1] should always be in the last group.1c - Randomized groupsAdd an optional boolean to the last method: when true, the usernames will be randomized instead of being chosen sequentially./** * This method takes a list of usernames and separates them in different groups. * @param userNames the list of usernames * @param nGroups the number of groups * @param randomize if true, the groups will contain shuffled usernames; if false, the usernames will be added sequentially to the groups * @return an array of groups of usernames */String[][] createGroups(String[] userNames, int nGroups, boolean randomize) {}

Tags: Academic Paper Assistance, Assignment Help Australia, Cheap Essay Writing Service, Dissertation Writing Services

Order|Paper Discounts

Why Choose Essay Bishops?

You Want The Best Grades and That’s What We Deliver

Top Essay Writers

Our top essay writers are handpicked for their degree qualification, talent and freelance know-how. Each one brings deep expertise in their chosen subjects and a solid track record in academic writing.

Affordable Prices

We offer the lowest possible pricing for each research paper while still providing the best writers;no compromise on quality. Our costs are fair and reasonable to college students compared to other custom writing services.

100% Plagiarism-Free

You’ll never get a paper from us with plagiarism or that robotic AI feel. We carefully research, write, cite and check every final draft before sending it your way.