1-) Write a code to do following operations a-print the contents of file write a function to print the contents of a given file on screen. Your function prototype should be in given format. void PrintFileContent(FILE* fptr) b-copy contents of one file to another file write a function to copy contents of one file to another file. Convert all characters into uppercase while copying the content. You are allowed to use toupper() function in ctype library. Your function prototype should be in given format. void copy_file(FILE* fptr1,FILE* fptr2) c- count the Number of Characters in a File write a function to count the Number of Characters in a File. Your function prototype should be in given format. int findNumberofChar(FILE* fptr) Please design your main.c file as follow 1- Open a text file to read in your directory. 2- Create an empty text file for writing and reading in same directory. 3- Check if both files are opened. 4- Print the contents of first file by calling PrintFileContent function. 5- Call copy_file function to copy contents of first file to empty file. Electronics Engineering INF211 Edition: 25.12.2020 6- Call findNumberofChar function to count the Number of Characters in the second file. 7- Write the number of characters in the second file into the same file. 8- Print the contents of second file by calling PrintFileContent function.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

1-) Write a code to do following operations
a-print the contents of file
write a function to print the contents of a given file on screen. Your function prototype
should be in given format.
void PrintFileContent(FILE* fptr)
b-copy contents of one file to another file
write a function to copy contents of one file to another file. Convert all characters into
uppercase while copying the content. You are allowed to use toupper() function in ctype
library. Your function prototype should be in given format.
void copy_file(FILE* fptr1,FILE* fptr2)
c- count the Number of Characters in a File
write a function to count the Number of Characters in a File. Your function prototype
should be in given format.
int findNumberofChar(FILE* fptr)
Please design your main.c file as follow
1- Open a text file to read in your directory.
2- Create an empty text file for writing and reading in same directory.
3- Check if both files are opened.
4- Print the contents of first file by calling PrintFileContent function.
5- Call copy_file function to copy contents of first file to empty file.
Electronics Engineering INF211
Edition: 25.12.2020
6- Call findNumberofChar function to count the Number of Characters in the second
file.
7- Write the number of characters in the second file into the same file.
8- Print the contents of second file by calling PrintFileContent function.

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY