Write a program that counts how often each word occurs in a textfile and print the top 15, instead of 100, mostcommon words.
Note:
- A sample file is available on blackboard for your reference.Remember to use a looping structure to test the end-of-filecondition since you don’t know how many numbers are in a file.
- To keep the problem simple, you just need to split the words ina line based on the whitespace(s) so words like “the”, “The”, “I”,“`I”, “Alice,”, “Alice.”, “on,”, “you,”, “-“, “(c)”, … etc. eachwill be counted as a unique word.
- But feel free to challenge yourself if you would
OROR
- But feel free to challenge yourself if you would