Question: y existing source code files that may aready be in your IDE project and add a j to enter a decimal integer value within a
y existing source code files that may aready be in your IDE project and add a j to enter a decimal integer value within a specified range to indicate how much they ke Exclude any eaming it CIASE1 main.c. Write a program in that file to implement a survey that new one The survey will end and the results will be displayed when either a specific number of legal responses 6 have been entered or a specific number of consecutive out of range responses have been entered a product. 8 Since the program must be adaptable to any arbitrary number of respondents, response values. and 9 out-of-range counts, define and use the following 4 required macros wherever this information s 10 needed 1. MAX_RESPONDENTS -the maximum number of respondents 2. MIN RESPONSE_VALUE-the lowest permissible response value. 3. MAX_RESPONSE VALUE-the highest permissible response value. . OUT_ OF_RANGE LIMIT-t of 13 14 the number of consecutive out-of-range responses required to end the survey 16 You may define additional macros if you wish, but it must not be necessary to explicitly change any of 17 their values if the values associated with any of the 4 required macros above are changed 18 19 The code in function main must conduct the survey and display the results as follows 20 1. Use a 1-dimensional array having exactly the number of elements as there are legal response values. Each element represents a specific legal response value and contains a count of how many of them have occurred (similar to note 6.3). No other arrays are permitted 2. Use a variable named consecutiveRangeErrors to count the number of consecutive out-of-range responses: 25 26 a. If an illegal response occurs increment and test that variable. If the maximum count has not yet been reached display an error message and re-prompt the same user, it it has been reached end the survey b. If a legal response occurs set the variable back to 0 and increment the appropriate array element. End the survey if the maximum number of respondents have entered legal 9 0 . It 3. Once the survey has ended display a table in descending rating order like the one below indicates the total number of responses for each possible rating. DO NOT put any blank lines or other dividers between table entries. The least significant digits of all values must be aligned for 2 readability Rating Responses 25 50 100 -1239 Your program must work correctly for all cases where MIN_RESPONSE VALUE is less than or equal to MAX_ RESPONSE VALUE, regardless of their actual values. This includes cases where one or both are negative If you think you need an array having MAX_RESPONDENTS elements you have not understood the requirements above and are totally on the wrong track. NOTE Manually re-run your program several times with at least the following sets of macro values and a sufficient number of user input values to verify functionality. To test with different macro values you will, of course. need to recompile after each change
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
