To complete this exercise, we need to create two separate programs. The first program will ask the user for survey responses and save them in a file called "numbers.txt". The second program will read the responses from "numbers.txt", count how many times each response occurs, and save the results in a file called "output.txt".
First Program: Saving Survey Responses to "numbers.txt"
1. Create a program that asks the user for survey responses.
2. Open a file called "numbers.txt" to save the responses.
3. Inside a loop, ask the user for a response and write it to the file.
4. Once the user finishes entering responses, close the file.
Second Program: Reading Survey Responses from "numbers.txt" and Saving Frequency Counts to "output.txt"
1. Create another program that reads survey responses from "numbers.txt".
2. Open the "numbers.txt" file for reading and create a file called "output.txt" to save the frequency counts.
3. Create a data structure to store the frequency counts for each response.
4. Read each response from the file and update the corresponding frequency count.
5. After reading all responses, write the frequency counts to "output.txt".
6. Close both the input and output files.
By running the second program, you will get an "output.txt" file that shows how many times each response appeared in the survey.