Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

1ST QUESTION C PROGRAM Write a program that will read the CHECK contents from input.txt file PHOTO BELLOW and write the contents to the output.txt

1ST QUESTION C PROGRAM Write a program that will read the CHECK contents from input.txt file PHOTO BELLOW and write the contents to the output.txt file. The contents of input.txt and output.txt files are given below. While writing to the output.txt file, the program will calculate the CGPA and write Probation beside value of CGPA, if it is less than 2.00..RUN IN CODE BLOCK.

2ND QUESTION Write the contents of the test_fseek.txt file generated by the code below: START CHECK PHOTO IN BELLOW #include void main() { FILE *fp; char string1[]="test_fseek.txt"; char string2[]="I am a student in the EEE Department"; char string3[]=" of Structured Programming Language class"; fp = fopen(string1,"w+"); fputs(string2, fp); fseek( fp, -14, SEEK_END ); fseek( fp, -8, SEEK_CUR ); fputs(string3, fp); fclose(fp); RUN image text in transcribed

4. a) Write a program that will read the contents from input.txt file and write the contents [7] to the output.txt file. The contents of input.txt and output.txt files are given below. While writing to the output.txt file, the program will calculate the CGPA and write "Probation" beside value of CGPA, if it is less than 2.00. input.txt My student ID is: 1234 My GPAs are: 3.35 3.80 4.00 3.67 My student ID is: 5678 My GPAs are: 2.39 2.67 2.90 3.10 My student ID is: 9012 My GPAs are: 1.39 1.67 2.65 1.55 My student ID is: 3456 My GPAs are: 3.90 3.67 3.00 3.57 My student ID is: 7890 My GPAs are: 3.39 3.67 4.00 3.78 Output.txt My student ID is: 1234 My GPAs are: 3.35 3.80 4.00 3.67 CGPA: 3.71 My student ID is: 5678 My GPAs are: 2.39 2.67 2.90 3.10 CGPA: 2.77 My student ID is: 9012 My GPAs are: 1.39 1.67 2.65 1.55 CGPA: 1.82 Probation My student ID is: 3456 My GPAs are: 3.90 3.67 3.00 3.57 CGPA: 3.54 My student ID is: 7890 My GPAs are: 3.39 3.67 4.00 3.78 CGPA: 3.71 b) Write the contents of the test_fseek.txt file generated by the code below: #include void main() [3] FILE * fp; char string1[]="test_fseek.txt"; char string217="I am a student in the EEE Department": char string301="of Structured Programming Language class"; fp = fopen(string1,"w+"); fputs(string2, fp); fseek( fp. -14, SEEK END); fseek( fp, -8, SEEK CUR); fputs(string3, fp); fclose(fp)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image
Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students explore these related Databases questions