Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

IN C LANGUAGE: Polling) The Internet and the web are enabling more people to net

ID: 3856306 • Letter: I

Question

IN C LANGUAGE:

Polling) The Internet and the web are enabling more people to network, join a cause, voice opinions, and so on. The U.S. presidential candidates in 2008 used the Internet intensively to get out their messages and raise money for their campaigns. In this exercise, you’ll write a simple polling program that allows users to rate five social-consciousness issues from 1 (least important) to 10 (most important). Pick five causes that are important to you (e.g., political issues, global environmental issues). Use a one-dimensional array topics (of type char *) to store the five causes. To summarize the survey responses, use a 5-row, 10-column two-dimensional array responses (of type int), each row corresponding to an element in the topics array. When the program runs, it should ask the user to rate each issue. Have your friends and family respond to the survey. Then have the program display a summary of the results, including: a) A tabular report with the five topics down the left side and the 10 ratings across the top, listing in each column the number of ratings received for each topic. b) To the right of each row, show the average of the ratings for that issue. c) Which issue received the highest point total? Display both the issue and the point total. d) Which issue received the lowest point total? Display both the issue and the point total.

Explanation / Answer

/*I know its late(I hadnt seen the post), but perhaps you can learn a bit or still use it if you want. This doesnt do the averages or the high and low, and I wrote it so it repeats itself until you are done as opposed to writing to a database, hope it helps a bit, it should compile for you*/ #include #include #include #include #include using namespace std; int main () { string issues[]={"Health care ","Social Security ","Trade Deficit ","Immigration ","Poverty "}; int ans[5][10]; int temp; char c='y'; for (int i=0;i