Question: Assignment Title: Advanced Playlist Manager with Sorting, Search, and Recently Played Queue Objective: This assignment challenges students to implement a playlist manager using both ArrayLists
Assignment Title:
Advanced Playlist Manager with Sorting, Search, and Recently Played Queue
Objective:
This assignment challenges students to implement a playlist manager using both ArrayLists and LinkedLists, allowing them to practice list manipulation, searching, sorting, and managing data with a queue. This will deepen their understanding of different data structures and their tradeoffs.
Assignment Requirements
Part : ArrayListBased and LinkedListBased Playlist
Playlist Class Implementations: Create PlaylistArrayList and PlaylistLinkedList classes, each managing a playlist of songs.
Define each song with the following attributes:
Title
Artist
Duration in seconds
Implement the following methods for each playlist:
addSongSong song: Adds a song to the end of the playlist.
insertSongint index, Song song: Inserts a song at a specified position.
removeSongint index: Removes a song from a specified position.
getSongint index: Retrieves the song at a specified position.
shuffle: Randomly shuffles the playlist. You may use Javas random number generator
printPlaylist: Displays all songs in the playlist.
Sorting and Searching: Implement sorting methods:
sortByTitle: Sorts songs alphabetically by title.
sortByArtist: Sorts songs alphabetically by artist.
sortByDuration: Sorts songs by duration.
Implement search methods:
searchByTitleString title: Finds and returns the position of the song with the given title.
searchByArtistString artist: Finds and returns the position of the first song by the given artist.
Testing Requirements: Test each method with sample playlists to ensure functionality, focusing on sorting, searching, and shuffle.
Part : Recently Played Queue
Recently Played Queue Class: Implement a RecentlyPlayedQueue class that tracks the last songs that were played.
Use a queue structure to manage the 'recently played' list:
addRecentlyPlayedSong song: Adds a song to the queue. If full, removes the oldest song.
printRecentlyPlayed: Prints the list of recently played songs in order.
Integration with Playlist Manager: Modify the playlist manager to add a song to the recently played queue when played retrieved with getSong
Ensure that only the last songs are displayed when the recently played queue is printed.
Testing Requirements: Test the queue by viewing multiple songs and verifying the correct order of the recently played list.
Part : Playlist Manager Application with Enhanced Features
Enhanced User Menu
Build a PlaylistManager class with the following options:
Add Song: Add a new song to the playlist.
Insert Song at Position: Insert a song at a specified index.
Remove Song: Remove a song by index.
View Song: Display a song, adding it to the recently played queue.
Shuffle Playlist: Randomize the song order.
Print Playlist: Display all songs in the current playlist.
Sort Playlist: Sort by title, artist, or duration.
Search for Song: Search by title or artist and display position.
View Recently Played Songs: Display last played songs.
Switch Playlist Type: Toggle between ArrayList and LinkedListbased playlists.
Deliverables
Source Code: Implementations for PlaylistArrayList, PlaylistLinkedList, RecentlyPlayedQueue, and PlaylistManager.
Test Cases: Include test cases for each method to verify playlist manipulation, sorting, searching, and queue functionality.
Analysis Report: A brief analysis of the time and space complexities of each operation in ArrayLists and LinkedLists.
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
