Question: Implement a function getFileText ( ) that takes a fileName as a parameter. The file, glossary.txt , contains a social media initialism and its meaning,
Implement a function getFileText that takes a fileName as a parameter. The file, glossary.txt contains a social media initialism and its meaning, separated by a colon.
example:
MTFBWY: May The Force Be With You
You may assume that the file is not empty. getFileText will read a file to a String variable and then convert it to a list of strings. getFileText will return a list of all the social media terms and their meanings. Youwill needtoremove any TnFB: Facebook', IG: Instagram', LI: LinkedIn', TW: Twitter', YT: YouTube', DM: Direct Message', MT: Modified Tweet', PM: Private Message', RT: Retweet', : Information', AF: As F 'AFAIK: As Far As I Know', 'AMA: Ask Me Anything', 'ASL: AgeSexLocationB: Before', 'BAE: Before Anyone Else', BC BC: Because', BFF: Best Friends Forever', BRB: Be Right Back', 'BTAIM: Be That As It May', BTS: Behind the Scenes', 'BTW: By The Way', 'DAE: Does Anyone Know? Implement a function glossaryTerms fname that takes a filename. The function will call getFileText to get the list from the file. Your code will convert each list entry into a keyvalue pair and store it in a dictionary. Assign the social media initialism as the key and its meaning as the value:example:key: MTFBWY value: May The Force Be With YouglossaryTerms will call printWordD dictionary to display the dictionary in keyvalue pairs.FB: FacebookIG: InstagramLI: LinkedInTW: TwitterYT: YouTubeDM: Direct MessageMT: Modified TweetPM: Private MessageRT: Retweet: Information
Implement a function findMeaning which takes a string, key, as a parameter. This function will return the keyvalue pair.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
