[Solved]Cop 3223 Sec 1 Spr 19 C Programming Test 4 56 Points 1 16 Points Write Complete Program Re Q37265140
Please correct and explain my mistakes in my finalcode.


COP 3223 Sec 1: Spr ’19 C Programming Test 4 (56 points) 1. (16 points) Write a complete 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 one float value gross.income All this is from a file. You must prompt for the input filename as a string that is certain to be less than 30 chars long, and you must open the input file. You must also prompt for an output filename string (also less than 30 chars long), and open an output file. Read the integer n, and for each subsequent input line, write to the output file the gross income. Also keep track of the average gross.income of only those whose income is greater than 100,000 but less than 200.00 and finally write this to the output file too. Remember to close both files. CAREFULLY CONSIDER THE SAMPLE SHOWN BELOW. ENSURE YOU, UNDERSTAND THAT THE AVERAGE IS ONLY THE AVERAGE FOR A FEW VALUES, in the example below, only two values. int SSN Ploat gross-inco me Char Word C303, word2[30], Sample input File Notes 1111 90000 2222 140000 3333 160000 Output File int i,n, 90000 140000 160000 150000 gross-income iS between 1000 00 200000 ะ 150,000 1bo000/80,000/ 圡include くstdio.h) # include (Std lib:W ini main) FILE p1 FILE to2 Hloot grass-incame, ave rage-gross income-0,n, Char Word[30], word1C301 int SSNİ: printt Enter input nome. J printfl Enter outout Inene: ” Scont (e Word2) p1- open( Hord) p fopen(word2, H or i oin, it) if(gross-income > 100000) g10s- ncome <200000) 5 average-g ross-income gross-income +4n”, gross-income); fprint f(4ρ2 a vera ge-gross- income -lavercge-gross- income fprintf(fp2,”#4 n”, average, gross-income). clase(fp1); f close(tp2), return 0, Show transcribed image text COP 3223 Sec 1: Spr ’19 C Programming Test 4 (56 points) 1. (16 points) Write a complete 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 one float value gross.income All this is from a file. You must prompt for the input filename as a string that is certain to be less than 30 chars long, and you must open the input file. You must also prompt for an output filename string (also less than 30 chars long), and open an output file. Read the integer n, and for each subsequent input line, write to the output file the gross income. Also keep track of the average gross.income of only those whose income is greater than 100,000 but less than 200.00 and finally write this to the output file too. Remember to close both files. CAREFULLY CONSIDER THE SAMPLE SHOWN BELOW. ENSURE YOU, UNDERSTAND THAT THE AVERAGE IS ONLY THE AVERAGE FOR A FEW VALUES, in the example below, only two values. int SSN Ploat gross-inco me Char Word C303, word2[30], Sample input File Notes 1111 90000 2222 140000 3333 160000 Output File int i,n, 90000 140000 160000 150000 gross-income iS between 1000 00 200000 ะ 150,000 1bo000/80,000/
圡include くstdio.h) # include (Std lib:W ini main) FILE p1 FILE to2 Hloot grass-incame, ave rage-gross income-0,n, Char Word[30], word1C301 int SSNİ: printt Enter input nome. J printfl Enter outout Inene: ” Scont (e Word2) p1- open( Hord) p fopen(word2, H or i oin, it) if(gross-income > 100000) g10s- ncome
Expert Answer
Answer to COP 3223 Sec 1: Spr ’19 C Programming Test 4 (56 points) 1. (16 points) Write a complete program that reads in from the … . . .
OR

