A little backstory: I have some code written by the gentleman before me. I have practically no java experience, but need to make the code that he started work for our new standards. I have NO clue where to even begin, and would love some helpful guidance.
The code that we have:
public class employeeSurveyCalculator { public static void main(String args[]) { // Employee answers to the survey char[][] answers = { {'A', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'}, {'D', 'B', 'A', 'B', 'C', 'A', 'E', 'E', 'A', 'D'}, {'E', 'D', 'D', 'A', 'C', 'B', 'E', 'E', 'A', 'D'}, {'C', 'B', 'A', 'E', 'D', 'C', 'E', 'E', 'A', 'D'}, {'A', 'B', 'D', 'C', 'C', 'D', 'E', 'E', 'A', 'D'}, {'B', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'}, {'B', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'}, {'E', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'}}; // Key to the questions char[] keys = {'D', 'B', 'D', 'C', 'C', 'D', 'A', 'E', 'A', 'D'}; // Analyze all answers for (int j = 0; j < answers.length; j++) { // Check one Employee int typeOneCount = 0; for (int i = 0; i < answers[j].length; i++) { if (answers[j][i] == keys[i]) typeOneCount++; } // end for fro j index } // end for for i index }// end main method } //end class
We have a survey that we send out to our small teams to check personality compatibility. In particular, we are looking for a certain personality type. These people will be identified by answering the questions a certain way. These answers have been identified and placed in the key array.
I am supposed to now identify other personality types. This is still in the planning stages, so I have been tasked with expanding this code to create a running count of how many people answer what letter for what question. For example, how many people answer Question 1 with A, with B, with C, etc.
They tell me this is easy to do, but I am at a complete loss. Can I get some helpful hints to help me on the right track?
Thank you so much!
Lorelai