Write a program to implement a survey that prompts respondents to enter an integral value within a specified range to indicate how they like a new product. Since the program must be adaptable to any arbitrary number of respondents and value ranges, define macro MAX_RESPONDENTS to represent the maximum number of respondents, MIN_RESPONSE_VALUE to represent the lowest permissible response value, and MAX_RESPONSE_VALUE to represent the highest. Use an array to accumulate the total count of how many of each response value has been entered. If a value is out of range, it must be discarded and the same respondent prompted again. If a respondent desires to terminate the survey before all respondents have been polled, that respondent may enter a specific number of out of range responses in a row, which the program uses as a survey termination flag.

Once the survey is terminated, either because all respondents have been polled or because of out of range responses, the program will output the total number of respondents that gave each of the possible responses.

Program output should look something like the following, depending upon the chosen range:
Rating Number of Responses
10 25
9 50
8 100
... ...
-1239 0
• Declare only one array, which must contain one and only one element for each legal response value. This array may not contain a separate element for each respondent.
• Use a macro to define the number of consecutive out of range responses required to terminate.
• The program is to be done using classes.
• Test using different numbers of respondents and both negative and positive response ranges.

Recommended Answers

All 9 Replies

Do your own homework. Daniweb is not a cheating service.

> Ask specific questions about what you don't understand, all what you've done is just copied and pasted your assignment in this thread :) ...

> If you want help, do some effort first, give it a try, and when you get stuck you can always ask questions ...

Hey tux, why do you use a > prefix with replies? Generally it's used for quotes, which makes your posts somewhat difficult to decipher.

Hey tux, why do you use a > prefix with replies? Generally it's used for quotes, which makes your posts somewhat difficult to decipher.

I'm just using it to distinguish different steps, but if you'd like that I don't do it anymore just say it :) ...

>but if you'd like that I don't do it anymore just say it
I don't dictate how people should post, I have my own quirks as well. ;)

>but if you'd like that I don't do it anymore just say it
I don't dictate how people should post, I have my own quirks as well. ;)

Yeah, but if it's confusing I'll try to avoid doing this ...

sir i need the help in whole framing...actually the thing was i need 2 du it as early as possible and due to some personal reasons i cudnt du this..it wuld be really gr8 if you an help me for this..

Please do some effort first !

sir can i have your yahoo id...we can talk over messanger

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.