You have been asked by your manager to create a


Java language:

You have been asked by your manager to create a user-friendly application that will present a survey to your customers. The application will compile and analyze the results entered by the survey respondents who are customers who have shopped at your online store. You will deliver your working application with a design document and test results for the final task in this course.

As you progress through each phase in the course, the tasks you complete will provide you with code that will help you build your survey application. You are to begin the design of the application in this first task.

The following are requirements of the Survey class:

The Survey class will have a static class variable that stores the current respondent's ID. As respondents complete the survey, this value will be incremented by one.

The Survey class will have an instance variable to hold the title of the survey.

The Survey class should have two overloaded constructors.

The first constructor should take no arguments. It should set the survey title to a default value of "Customer Survey".

The second constructor should accept a String value for the survey title. It should reset the static respondent ID to zero. It should set the survey title to the value passed into the constructor.

The survey class should have a generateRespondentId() method which returns the next value of the respondent ID. This method should increment the static instance variable for the respondent ID by one.

2. Enhance your your Survey class to include an attribute, which is a grid to log survey results. It is expected that at most you will have 10 respondents to 10 survey questions. You must use a 2-dimensional array to represent a grid.

The Survey class should have a displaySurveyResults() method that prints out the name of the survey and displays the entire grid that holds the results.

The Survey class should have a displayQuestionStats() method that takes an int value that is the question number and displays the responses entered so far for that question in tabular form.

Your Survey class should store 10 questions in an array of Strings. Your class should have an enterQuestions() method that allows the user to enter 10 questions for a 10-question survey. This should be done prior to the survey application starting a survey.

Create a method in your Survey class called "logResponse()." This method should take three arguments. The first argument is an int value (which is the respondent id); the second argument is an int value (which is the question number); and the third argument is an int value, which is the response entered (value from 1 to 5). This method should enter the response into the right location on the survey grid that corresponds to the respondent ID and the question number.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: You have been asked by your manager to create a
Reference No:- TGS02313950

Now Priced at $20 (50% Discount)

Recommended (98%)

Rated (4.3/5)