Computers and Technology

Write a c program to run on ocelot to read a text file and print it to the display. it should optionally find the count of the number of words in the file, and/or find the number of occurrences of a substring, and/or take all the words in the string and sort them lexicographically (ascii order). you must use getopt to parse the command line. there is no user input while this program is running. usage: mywords [-cs] [-f substring] filename • the -c flag means to count the number of words in the file. a word would be a series of characters separated by spaces or punctuation. a word could include a hyphen or a single apostrophe. • the -s option means to print the words in the file sorted by ascii order. • the -f option will find the number of occurrences of the given substring. • you may have any number of the flags included or none of them. • the order they should be run would be: -s first, -c second, and -f third. • output should be well formatted and easy to read. the source file should have your name & pantherid, a description and it should have the affirmation of originality included in a comment at the top. code should be nicely indented and commented. create a simple makefile to compile your program into an executable called mywords.

answer
Answers: 3

Similar questions

Do you know the correct answer?
Write a c program to run on ocelot to read a text file and print it to the display. it should option...

Questions in other subjects: