#define ALLOW_INSTRUCTOR_CODE /*************************************************************************** *************************************************************************** ****** BEFORE BEGINNING OR TURNING IN THIS EXERCISE IT IS EXTREMELY ****** ****** IMPORTANT THAT YOU READ, FULLY UNDERSTAND, AND ADHERE TO THE ****** ****** REQUIREMENTS STATED IN THE DOCUMENT TITLED, "ASSIGNMENT ****** ****** SUBMISSION REQUIREMENTS", DOWNLOADABLE FROM THE COURSE WEB ****** ****** SITE. ****** *************************************************************************** **************************************************************************/ /*************************************************************************** ************* C/C++ Programming 2: Assignment 3 - Exercise 3 ************* ********* BEGIN EXERCISE REQUIREMENT - THIS MUST BE A "C" PROGRAM ********* *************************************************************************** (3 points) Write function RecordOpinions: RecordOpinions syntax: void RecordOpinions(void); Parameters: none Synopsis: Prompts viewers for their opinions of a new TV program, where responses may range from a value of -ENDPOINT (worst), to 0 (neutral), to +ENDPOINT (best). A tally of the quantity of each type of response is kept in an array having (2*ENDPOINT + 1) elements until a termination value of TERMINATE is entered, at which time the total number of responses of each type is displayed in tabular format. Return: void * The actual response value must be used directly as an array index (negative and positive indices) without going out of bounds on the array. * Define the absolute value of the endpoints using a single macro so that changing only this one definition changes the endpoints everywhere (including the size of the array and in prints and comments). * Define TERMINATE as 999. If any out of range value other than TERMINATE is entered, reject it and reprompt the user. * Test the program by redirecting input from file "TestFile6.txt", downloaded from the course web site. *************************************************************************** ************************ END EXERCISE REQUIREMENT ************************* **************************************************************************/ /*************************************************************************** * BEFORE PRINTING THIS ASSIGNMENT TO TURN IN, DELETE THIS COMMENT AND * EVERYTHING ABOVE IT. **************************************************************************/ /* * TODO: * REPLACE THIS COMMENT WITH YOUR TITLE BLOCK. */ /* * TODO: * REPLACE THIS COMMENT WITH YOUR C CODE, PLUS ANYTHING NECESSARY TO * SUPPORT MY TEST CODE BELOW. DO NOT INCLUDE ANY UNNEEDED HEADER FILES! */ /*************************************************************************** * BEFORE PRINTING THIS ASSIGNMENT TO TURN IN, DELETE THIS COMMENT AND * EVERYTHING BELOW IT. **************************************************************************/ /* ***** Change nothing below this comment without instructor permission. **** * Everything that follows was written to help test/verify your code. You * do not need to understand the details of my code to write yours! */ #ifdef ALLOW_INSTRUCTOR_CODE int main(void) { RecordOpinions(); return EXIT_SUCCESS; } #endif