Hi I am confused and stuck on this I have a method enterQuestions() that uses a String array to hold 10 questions for a survey. However I also need to display these 10 questions and then store the responses as an int between 1 and 5. Then display the responses in a my logResponses() method. I am confused I fell like I may be close but I am not sure. Any help is appreciated.
import java.util.*; public class Survey21 { private Scanner in = new Scanner(System.in); private String surveyTitle; private static int rID; private static int respondentID; private int[][] responses = new int[10][11]; String questions[] = new String[10]; //Constructors // Default Constructor Survey21() { surveyTitle = "Customer Survey"; } // Overloaded Constructor 1 Survey21(String title, int rID) { this.surveyTitle = title; rID = 0; generateRespondentId(); } public static int getrID() { return rID; } public static void setRespondentID(int respondentID) { respondentID = rID; } public String getTitle() { return surveyTitle; } public void setTitle(String title) { surveyTitle = title; } public static int generateRespondentId() { rID = ++respondentID; return rID; } // displays name of survey and entire grid of results public void displaySurveyResults() { System.out.printf("%s\n\n", getTitle()); logResponse(); } // dispalys question number and results for that question so far public void displayQuestionStats(int questionNumber) { } // enter questions and store in an array of Strings public void enterQuestions() { for (int i = 0; i < questions.length; i++) { System.out.println("Please enter a question!"); questions[i] = in.nextLine(); } /*TEST TEST*** */ } // enters the response in the correct grid public void logResponse() { for (int i = 0; i < responses.length; i++) { System.out.print(questions[0] + "\n"); responses[i][i] = in.nextInt(); System.out.print(questions[1] + "\n"); responses[i][i] = in.nextInt(); System.out.print(questions[2] + "\n"); responses[i][i] = in.nextInt(); System.out.print(questions[3] + "\n"); responses[i][i] = in.nextInt(); System.out.print(questions[4] + "\n"); responses[i][i] = in.nextInt(); System.out.print(questions[5] + "\n"); responses[i][i] = in.nextInt(); System.out.print(questions[6] + "\n"); responses[i][i] = in.nextInt(); System.out.print(questions[7] + "\n"); responses[i][i] = in.nextInt(); System.out.print(questions[8] + "\n"); responses[i][i] = in.nextInt(); System.out.print(questions[9] + "\n"); responses[i][i] = in.nextInt(); System.out.println("The responses are:\n"); System.out.print(" "); // align column heads // create a column heading for each question for (int qNumber = 1; qNumber < responses[0].length; qNumber++) { System.out.printf("Question number %d ", qNumber); System.out.println("Response"); // column heading } for (int response = 0; response < responses.length; response++) { System.out.printf("Response %2d", response + 1); for (int qNumber : responses[response])// output responses { System.out.printf("%8d\n", qNumber); } } } } }