I am struggling with this assignment. I have it read the text file but not too sure how to complete the rest of the assignment. These are the 5 things my program is suppose to do. Only part I have working is Number 1.
1.Display All the concepts from the array
2. All the concepts from the array in alphabetical order (without using any predefined sorting functions or
editing the LIST file)
3. All the concepts from the array that contain spaces
4. All the concepts from the array that contain the letter A (small or large caps)
5. All the concepts from the array that end with a consonant
If you have 1, then you almost have 3, 4, and 5. Rather than just printing each, you check condition and print only if condition is true.
1.
FOR EACH concept in array
print concept
3,4,5.
FOR EACH concept in array
IF concept has X
THEN print concept
I do recommend writing three helper functions that each take concept as argument and return bool. That keeps the main code clean and simple.
2. You have to sort an array. You are not allowed to use function std::sort.
Again, write a separate function that takes the array as argument and implement the sort in that function.