How to use Files in your programs ================================= Note 1: The problem to be solved is: ====== (From Prac Test 4, Q10). Write a program that reads in from the first line an integer n, and thereafter on n subsequent lines two things per line (an int SSN and a float wages-earned). All this is from a file. You must prompt for the filename as a string that is certain to be less than 30 chars long. Open the file, etc., read everything, and keep a running total of all the wages earned, then when reading is complete, prompt for an output filename string, open it and write to it the average value of all the earnings. Note 2: We will divide the problem into TWO steps: the step of solving the ====== problem without files (simple program without files) and the step of adding files. We refer to the first step as the Baby or Logic step. The solution to the "Baby" stage, or "Logic" stage is: The starting program #include int main() { int n; int ssn; float wages, wagestotal=0; scanf("%d", &n); for(i=0;i int main() { FILE* fp1; FILE* fp2; int n,i; int ssn; float wages, wagestotal=0; char word[30],word2[30]; printf("type input fname:"); scanf("%s",word); printf("type output fname:"); scanf("%s",word2); fp1 = fopen(word, "r"); fp2 = fopen(word2,"w"); fscanf(fp1,"%d", &n); for(i=0;i