Assignment
11 - Arrays, Sorting and Searching
due
December 9th
The
purpose of this assignment is to give you practice working with arrays,
passing them to functions, sorting, searching and reading and writing
text files.
In
this program you will read two files and store their contents in
arrays. You will sort both arrays, and then search an array
for each element of the second array.
Program
Steps
- Open two input files and one output file.
- Read in these two files and store their contents in 2
arrays of strings. Do not use a vector.
- Sort both arrays using a selection sort.
- Search the dictionary
array for each keyword.
If the keyword is not present in the dictionary array,
write a message to the output file that the keyword is not
found in the dictionary
(see sample output below). Count the number of keywords not found.
You will print this number at the end of the program.
Output
Details
Required
console output
Number
of keywords not found = ??
<= the number is between 20 and 30
Required
file output
keyword not
found: alignas
keyword not
found: alignof
keyword not
found: and_eq
keyword not
found: asm
keyword not
found: bitand
keyword not
found: bitor
keyword not
found: char16_t
keyword not
found: char32_t
keyword not
found: compl
keyword not
found: const_cast
... |
Additional
Requirements
Six
points of this assignment will be used for program style.
For this, you will be graded on the following criteria:
- Following instructions
- Consistent and readable program format
- Accuracy of output format
- Choice of variable names
- Not using global variables
- Checking for and handling file open errors