Create a second function which will take one string argument. The purpose of the function is to search the text file created in step one, and determine how many occurrences of the argument passed into the function occur in the file. Return the number of occurrences to the caller along with the word “high”, “medium” , “low” or “none” based upon the number of hits received- 0 = none, 1-5 low, 6-10 medium, 11+ high.
Write a script which will call the appropriate methods to find how many occurrences of a random word occurs in the text file. Print out the number of occurrences and keyword (with an appropriate message) along with the length of time it took to complete the search – with an appropriate message.
Comments
Leave a comment