Q2) Write a function that opens a file named text.txt and counts for a character within that file. If the character being searched for is ", then return the number of all the characters in the file. The calculation of the word count, character count, and average word length is done in file.stats.c (which is given to you). Your job is to create a libfs.c and libfs.h. The following function prototype must be used: int find.char (const char filename, char thisc); A sample input file text.txt is provided to test your code. The expected output for the sample file is: Number of characters: 118 Number of vords: 21 Average word length: 4.4 Hints to understand how the provided file stats.c code works: "Hello world." has 12 characters, 2 words, and 1 period, and an average word length of 5 (measured in charac- ters), but how did you know there were two words? "Helloworld." is l word, 11 characters, has 1 period, and has an average word length of 10. What separates words? Can we count the separations instead of the actual words? Can we calculate the average word length by summing all the characters only associated with words? Read the file stats.c code carefully to find the logic, then write the function int find.char to complete the code. Note: In file stats.c we assume there are no double spaces in the input file and the file does not end in a space. The total number of characters includes spaces and punctuation. We also assume there are no linefeeds (In), and there are only periods for punctuation. The average word length does not include punctuation as part of a word. You only need to submit your libfs.c and libfs.h in your tar. Q3) Use a state machine to copy a file but replace the word "steak" with the word "chicken". The input file is named menu.txt, and the output file is to be named output.txt. In other words, vour code will onen and read (character hit nh