Question: ECE 1 4 0 0 Final Project Requirements Fall 2 0 2 4 Task You are to create a C program that reads English text
ECE Final Project Requirements Fall
Task
You are to create a C program that reads English text ie words from an input text file and
writes a sorted list of words and their frequencies of appearance to an output text file.
Requirements
The program will be graded using Cygwin and gcc
The input file will contain a sequence of English words with each word separated by whitespace
spaces tabs or newlines Each line of the output file shall contain one rightjustified word, a
space, and the number of times the word appears.
All words in the input file will characters or less in length. There is no limit to the size of the
input file.
The words in the output file must be sorted in ascending order alphabetical
Each word in the input file shall only appear once in the output file.
The program must be named wordCount.exe and source files must be called
wordCount.c myLinkedList.h and myLinkedList.c Include a makefile for building
your program. Submit a single zip file that includes your source code and makefile. Do not zip a
folder, only the individual files.
The program will expect commandline arguments to specify the names of the input and
output files. You MAY NOT hardcode the file names into your program. Example command
line input:
$ wordCountexe input.txt output.txt
$ wordCountexe myinput.txt myoutput.txt
Missing information on the command line andor failure to open input or output files shall result
in an error message and program termination.
Words and frequencies must be stored in a sorted linked list. You must use dynamic memory
allocation. You MAY NOT use an array.
Remember function headers, pseudocode, and the character line limit
Example Files
If the input file looks like this:
we the people of the united states in order to form
a more perfect union
establish justice
insure domestic tranquility
provide for the common defence
promote the general welfare
and secure the blessings of liberty
to ourselves and our posterity
do ordain and establish this constitution
for the united states of america
The associated output file should look like this:
a
america
and
blessings
common
constitution
defence
do
domestic
establish
for
form
general
in
insure
justice
liberty
more
of
ordain
order
our
ourselves
people
perfect
posterity
promote
provide
secure
states
the
this
to
tranquility
union
united
we
welfare
Notice that the output file contents are in alphabetical order with words rightjustified. Think
about different input file scenarios and craft appropriate input files to test those scenarios.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
