a) Open a text file containing a text in lowercase letters, without punctuation marks
b) Read the file word by word and computes
i. the number of words in the file
ii. the length of each word in the file
iii. the total number of characters (spaces excluded), i.e., the sum of the word lengths
iv. the average word length
Tasks o be implemented:
c) writes the filename and the above statistics into a variable whose type is a
program in C comparefilesthat performs the following actions
a. Two child processes are created
i. One process prompts the users to type thefile name of a file containing a text in lowercase
letters, without punctuation marks and executes the first code already described
(you don’t need to create a separate executable)
This process will send the content of the variable with all the statistics to the parent process
through an unnamed pipe. Then,the process prompts the user again for a new filename.
If the usertypes“exit” then it should stop prompting the user, and in cascade all process should
ii. The other process reads an unnamed pipe where the statistics of each file are written by
the parent process, and appends these data on an output file
b. The parent processreads from the pipe written by the first child process and writes
to the pipe read by the second child process
you will find attached two files to start with, you can choose the file you want.
deadline is before midenight or tomorrow if it is necessary.
16 freelancer đang chào giá trung bình €34 cho công việc này
Hi, I'm an expert in C programming and using pipe and fork. I'm sure that I can easily do this project for you. We can have a chat about it. Thanks.