Question: Using Java Q3. (40 pts) Note: This problem is probably harder than what would be in an exam, but it gives good practice. Dr. Conly
Using Java

Q3. (40 pts) Note: This problem is probably harder than what would be in an exam, but it gives good practice. Dr. Conly has a number of candy jars in his office that contain different types of candy (not really, sorry) Consider the following table describing the distribution of candy in each jar: Jar 0 Jar1 Jar 2 Jar 3 Jar 4 Candy 0 Candy 1 Candy 2 Candy 3 0 0 0 0 0 0 It can be seen, for example, that Jar 0 contains 1 piece of candy 0 and 2 pieces of candy 3, and that there are 2 pieces of Candy 2 in Jar 2, 1 piece in Jar 3, and 1 piece in jar 4. This data is represented as an array of integers like the one below: {0,0,5,1,2), {2,2,2,2,2)) Write a function results(int]] data) that takes a 2D array of int as an argument representing the candy distribution and prints the candy of which Dr. Conly has the most pieces and which jar contains the most pieces of candy overall. In the above case, there is more of candy 3 than any others (10 pieces) and Jar 2 contains the most pieces of all candies combined (11 pieces). You cannot make any assumptions about the number of candy types or jars, so do not hard-code these sizes in your function. Your output should look like the following: * . More of candy 3. More candy in jar 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
