Question
Task 2: Jukebox In this task we are going to make our own Music Jukebox. This jukebox consists of a customized song playlist. Your jukebox
Task 2: Jukebox In this task we are going to make our own Music Jukebox. This jukebox consists of a customized song playlist. Your jukebox is multi-functional and provide a number of functionalities. The most important functionality is storing songs in the list. The jukebox should allow us to adding and removing songs in our list. It also allows us to marking and unmarking songs as favorites. Interestingly, the box automatically adds a song into favorite if it is played more than thrice. Obliviously, there should be a functionality to play any specific song or playing the entire list or only favorite songs. It also returns the list of songs in the sorted format. This functionality required for a huge list of songs. The functionality of your implementation would be tested against a huge list of songs. Therefore, developers decided to implement using a Linked List. In this case, a linked list will be list of songs. We will be maintaining two linked lists: one for playlist and another for favorites songs. We will be having a class to store information about a song such as song name and singer. Another class will be required to providing mechanism for adding and removing songs in playlist and favorites. Implementation: You are required to implement: 1. Create a class MySongs that stores the information of song name, artists name and the number of times the song played. 2. Create a class JukeNode to create a node for the linked list. 3. Create a class MyJukeBox and write the following functions in the class. a. Write a function InsertSong() that inserts a song in the list. The insertion should be done in O(1). b. Write a function PlaySong() that plays a specific song from the list. This function will print the -playing
h. Write a function SortSongs() that returns a python list containing object of class MySongs sorted alphabetically w.r.t artists names
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