In this assignment, you will continue your project and update your design document to include the following:
Implement the enhancements to your Survey class according to the requirements presented above.
To accomplish the task of further developing your Survey class from your updated UML Class Diagram, you will need to implement the following attributes and methods:
Update your Design Document for this Phase and corrections needed from prior Phases. Update the screenshot(s) for the revised code to implement the enhancements to your Survey class.
public class Survey {
/**
* @param args the command line arguments
*/
//Array, Static, and instance variables
//Static
private static int respondentID = 0;
//Instance
private String surveyTitle;
//Array to store 10 Questions.
private String[] Questions = new String[10];
//Array for 10 respondent’s score
private int[][] Responses = new int[10][10];
Scanner input = new Scanner(System.in);
//Default constructor
public Survey() {
surveyTitle = “Customer Survey”;
}
//Overloaded constructor
public Survey(String title) {
respondentID = 0;
surveyTitle = title;
}
//The survey class should have a generateRespondentId() method which returns
//the next value of the respondent ID.
public int getrespondentID() {
respondentID++;
return respondentID;
}
//Method to getSurveyTitle
public String getSurveyTitle() {
return surveyTitle;
}
//Method to logResponse
public void logResponse(int respondentID, int questionNumber, int responseEntered)
{
Responses[respondentID][questionNumber-1] = responseEntered;
}
public void displaySurveyResults(int num)
{
System.out.print(“Question “+(num)+” : “+Questions[num-1]+” Reply : “);
if(Responses[respondentID][num] == 0)
{
System.out.print(“NO”);
}
else
{
System.out.print(“YES”);
}
}
//Method to enterQuestions using loop.
public void enterQuestions()
{
for(int i = 0; i < 10; i++)
{
System.out.println(“Enter Question “+(i+1)+” : “);
Questions[i] = input.nextLine();
}
}
//MEthos to displayQuaetionStats
public void displayQuestionStats(int num)
{
int answer;
System.out.print(“Question “+(num)+” : “+Questions[num-1]+” (0-No/1-Yes) : “);
answer = input.nextInt();
logResponse(respondentID, num, answer);
}

WhatsApp us