Question
Write a program that asks the user for a file name containing text. You program should process the file and perform analytics on the content:
Write a program that asks the user for a file name containing text. You program should process the file and perform analytics on the content:
1.Create output neatly showing:a.Wordb.Count of occurrences in the file
2.Produce the same output, except order the output in descending order based on the word count (b in the above)
3.Produce the same output, except order the output in alphabetical order based on the word (a in the above)
4.Your program should ignore things like commas, parenthesis, and other punctuation. It should also ignore the case of a word (e.g. Word and word and WORD should also be counted as one.)
5.Test your program with:
a.Tom Tom Club, Wordy Rappinghood: https://www.youtube.com/watch?v=6Vl1m5FYlAo
b.Daft Punk, Lose yourself to dance:https://www.youtube.com/watch?v=Z_Sf0gi-mGI
c.Joyner Lucas ADHD:https://www.youtube.com/watch?v=siiKTqLO0Cc
d.The heads, Damage Ive done:https://www.youtube.com/watch?v=62Mye3v3_KQ
6.Note: Words such as dont can be counted as a word, i.e. the character does not create two words for our analysis.You can also process words that end with an apostropheas is (i.e. dont need to remove it). (I am making this exception so that you can leave words like dontas is while not having to worry about changing words like thinkinto thinkin.)7.Your program should handle (via exception handler) a situation where the input file name is not foundor cant be opened (e.g. permission error or another program has exclusive access). Your program should continue prompting the user for a new file name, but also give them a way of exiting
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started