Using Python For this assignment, we’re going to build our own song remixing solution. As an example: given the following American children’s song (this is ONE of the 3 songs I’m giving you in the starter code that includes the data you'll use for your program): SONG = ['old macdonald had a farm - ee-i-ee-i-o.', 'and on that farm he had a cow - ee-i-e
Using Python
For this assignment, we’re going to build our own song remixing solution.
As an example: given the following American children’s song (this is ONE of the 3 songs I’m giving you in the starter code that includes the data you'll use for your program):
SONG = ['old macdonald had a farm - ee-i-ee-i-o.',
'and on that farm he had a cow - ee-i-ee-i-o.',
'with a moo moo here and a moo moo there',
'here a moo - there a moo - everywhere a moo moo',
'old macdonald had a farm - ee-i-ee-i-o.' ]
Do This:
Create a solution that allows users to:
- Load a new song from our playlist
- When requested, show the title of the song you’re currently remixing
- Continue the above operations on demand, until the user explicitly quits your program.
- Note that there is punctuation in some of the songs we've given you. When you remix a song, you should remove the punctuation (see the example reverse below). If you are unable to perform the remix, do NOT remove any punctuation - leave the song in its current state (see the last example below). Of course, if the song has already been altered, the "current state" has no punctuation anyway, so there's no punctuation alteration you would perform anyway.
We will be performing both unit-testing of your solution AND some whole-system tests as well. For unit tests, you must provide the following function in remix_master.py:
- load_song(selection: int) -> list
This function takes an integer (which is an index into our playlist) and returns a list that contains the selected song AND a string which represents the song title from our playlist. For the list returned: the song must be placed in index 0 and the title must be placed in index 1. If the selection is not valid, this function returns an empty list.
Important Note: This function is mapped to the user-centered selection operation, NOT our computer science index scheme. Therefore, load_song(1) retrieves the FIRST song in our playlist, not the second song.
PRE: This function's input parameters must be integers. Input values are NOT guaranteed to be within the range of our playlist
POST: If selection is found in the playlist, a list containing the song and the song title will be returned. Otherwise an empty list will be returned
Example screen captures are below.
Note that if you try to substitute a new word for a song and the song cannot be remixed, you should leave the current version untouched.
- For your development effort, I’m giving you 3 songs for my playlist. Do NOT hard-code your solution based on these 3 songs!!! During our testing of your solution, we will expand the playlist to more than the three original songs. Your solution should be flexible enough to handle any sized playlist that has at least 1 song in it. So, if my test playlist has 7 songs in it, your solution should still work properly.
- Focus on good procedural decomposition where each of your functions are short (<15 lines of code, discounting comments) and doing 1 thing well (NB: Your main() can be a bit longer than 15 lines, if your user menu is being handled there).
- No global variables (Global CONSTANTS are okay)
- Stretch-goal (try your best on this): Work to see if you can design your solution with a good "separation of concerns". See if you can construct your code for the user-interface to deal primarily with those aspects (e.g. getting input from the user and printing to the screen) and the other "business logic" to work without intermingling print statements, etc.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images