Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Homework 08- Low Level VO Homework 08- Low Level VO Function Name: nusicAwards Function Name: catchyCounter Inputs: 1. (char) Filename of a text file containing

image text in transcribed

Homework 08- Low Level VO Homework 08- Low Level VO Function Name: nusicAwards Function Name: catchyCounter Inputs: 1. (char) Filename of a text file containing the winners of a music awards show 2. (char) Category of award you need to change 3. (char) Artist andfor song you should substitute as the winner Inputs: 1. 2. (char) The filename of a text file containing lyrics to a song (char) A word/phrase to count Outputs: Outputs: 1. (double) The number of times the word/phrase appears None Background File Outputs You are starting a job as a songwriter for some of the music industry's biggest stars. But before you can write your first hit single, you need to figure out what makes a song catchy. You find that repetition can be very effective, so you decide to count the number of times a specific word/phrase appears in notoriously catchy songs. 1. An updated text file containing the new winner under the appropriate category Background You are a high-ranking official working for a certain music awards show. You have been trusted with the responsibility of getting the proper list of categories and winners on stage to be announced. However, you've discovered that someone has been changing the results of certain categories to the performers that they think should win. It is up to you to keep an eye on those categories that are potentially altered, and make sure that the correct winner gets announced on stage. Function Description: Write a function in MATLAB that counts the number of times a certain word or phrase appears in a song's lyrics. The first input will be the filename of a .txt file that contains the lyrics to a song. The second input will be the word/phrase you are counting in those lyrics. Your function should output the total number of times that word/phrase appears in the .xt file, regardless of case. Function Description: Write a function that will read through a text file to find the given category (2nd input), Example: beat it.txt: and change the winner to the one specified (3rd input). Then write the results to a new file, titled coriginalFileName>_updated.txt Just beat it, beat it, beat it, beat it No one wants to be defeated Showin' how funky and strong is your fight It doesn't matter who's wrong or right Just beat it (beat it) Example: results.txt: Album of the year: 24K Magic Bruno Mars Song of the year: Despacito Luis Fonsi Best Rap Song: HUMBLE. Kendrick Laman >num catchyCounter('beat_it.txt, 'beat it') >> musicAwards('results.txt "Song of the year', 'That's What I Like Bruno Mars') num6 Notes: Because the phrase may be longer than one word, you should use strfind (). Also, the word or phrase that you are looking for might be a part of a larger word or phrase. You do not need to check if a phrase occurs across multiple lines. results_updated.txt: Album of the year: 24K Magic - Bruno Mars Song of the year: That s What I Like Bruno Mars Best Rap Song: HUMBLE. Kendrick Laman . Notes: The categories will always be separated from the songs/artist with a colon. The category that you will have to change will never be on the last line of the text file

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro SQL Server Wait Statistics

Authors: Enrico Van De Laar

1st Edition

1484211391, 9781484211397

More Books

Students also viewed these Databases questions

Question

Describe what happens according to the amyloid cascade hypothesis.

Answered: 1 week ago

Question

How can managers create a culture for change?

Answered: 1 week ago

Question

fscanf retums a special value EOF that stands for...

Answered: 1 week ago

Question

What were the reasons for your conversion or resistance?

Answered: 1 week ago