Read a series of words from a disk file and place them in a linked list. Each
Question:
-
Read a series of words from a disk file and place them in a linked list. Each
node in the list should contain one word. The number of words is not known until runtime. Each word is guaranteed shorter than 20 characters. The total number of words is no greater than 100.
-
Remove any word in the list containing a 'w' or 'k'.
-
In all the remaining words, change all the letter 'a' to 'z'.
-
Insert your own first name after the word “students”.
-
Print out remaining words separated by '\n' and the total number of words.
Bonus:
6. Sort all the remaining words alphabetically. Print out all the words separated
by ‘\n'.
Miraculous:
The purpose of this assignment is to practice the usage of linked list. String operation will also be involved. One sample code and data file has been provided. Please review the slides about linked list and string operation. In the data file, each word is strictly separated by one ‘\n’, no extra spaces involved.
--------- End of Prompt ---------
Note:
A list of 36 words in a .txt file were given to the students.
Foundations of Finance
ISBN: 9780135160619
10th edition
Authors: Arthur J. Keown, John H. Martin, J. William Petty