34.7k views
4 votes
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 364 Chapter 7 C Pointers int), each row corresponding to an element in the topics array.

User KnuturO
by
7.2k points

1 Answer

5 votes

Final answer:

To create a simple polling program, define the causes and use arrays to store the survey responses. Calculate the average rating for each cause to summarize the survey responses.

Step-by-step explanation:

The question is asking about writing a simple polling program that allows users to rate five social-consciousness issues. The program should use a one-dimensional array to store the causes and a two-dimensional array to store the survey responses. The purpose of the program is to summarize the survey responses.

To start, you need to define the five causes that are important to you. These causes can be political issues, global environmental issues, or any other social-consciousness issues. Then, create a one-dimensional array called 'topics' to store these causes. Next, create a two-dimensional array called 'responses' with 5 rows and 10 columns to store the survey responses.

Once you have defined the topics and responses arrays, you can start collecting the users' ratings for each cause. Display the causes to the users and ask them to rate each cause from 1 (least important) to 10 (most important). Store the ratings in the corresponding row of the responses array.

Finally, you can summarize the survey responses by calculating the average rating for each cause. Loop through each row of the responses array and calculate the average rating for that cause. Print out the average rating for each cause to display the summary of the survey responses.

User Jeltok
by
7.7k points