Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Matlab code Function Name: musicAwards Inputs: ( char) Filename of a text file containing the winners of a music awards show ( char) Category of

Matlab code

Function Name: musicAwards

Inputs:

( char) Filename of a text file containing the winners of a music awards show

( char) Category of award you need to change

( char) Artist and/or song you should substitute as the winner

Outputs:

None

File Outputs:

1. An updated text file containing the new winner under the appropriate category

Banned: fileread() and textscan()

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, youve 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 that will read through a text file to find the given category (2nd input), and change the winner to the one specified (3rd input). Then write the results to a new file, titled _updated.txt.

Example:

results.txt: Album of the year: 24K Magic - Bruno Mars Song of the year: Despacito - Luis Fonsi Best Rap Song: HUMBLE. - Kendrick Lamar 

>> musicAwards('results.txt', 'Song of the year', 'That's What I Like - Bruno Mars')

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 Lamar 

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

Database And Expert Systems Applications 19th International Conference Dexa 2008 Turin Italy September 2008 Proceedings Lncs 5181

Authors: Sourav S. Bhowmick ,Josef Kung ,Roland Wagner

2008th Edition

3540856536, 978-3540856535

More Books

Students also viewed these Databases questions

Question

Provide the IUPAC names for each of the following

Answered: 1 week ago