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 1400 Final Project Requirements Fall 2024
Task
You are to create a C program that reads English text (i.e. words) from an input text file and
writes a sorted list of words and their frequencies of appearance to an output text file.
Requirements
1. The program will be graded using Cygwin and gcc.
2. 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 (right-justified) word, a
space, and the number of times the word appears.
3. All words in the input file will 20 characters or less in length. There is no limit to the size of the
input file.
4. The words in the output file must be sorted in ascending order (alphabetical).
5. Each word in the input file shall only appear once in the output file.
6. 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.
7. The program will expect 2 command-line arguments to specify the names of the input and
output files. You MAY NOT hard-code the file names into your program. Example command-
line input:
$ .\wordCount.exe input.txt output.txt
$ .\wordCount.exe my_input.txt my_output.txt
8. Missing information on the command line and/or failure to open input or output files shall result
in an error message and program termination.
9. Words and frequencies must be stored in a sorted linked list. You must use dynamic memory
allocation. You MAY NOT use an array.
10. Remember function headers, pseudocode, and the 80-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 1
america 1
and 3
blessings 1
common 1
constitution 1
defence 1
do 1
domestic 1
establish 2
for 2
form 1
general 1
in 1
insure 1
justice 1
liberty 1
more 1
of 3
ordain 1
order 1
our 1
ourselves 1
people 1
perfect 1
posterity 1
promote 1
provide 1
secure 1
states 2
the 6
this 1
to 2
tranquility 1
union 1
united 2
we 1
welfare 1
Notice that the output file contents are in alphabetical order with words right-justified. 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!