To construct a Song, a title and duration should be passed into its constructor. A new song will begin with no likes nor dislikes. If an invalid value is passed for title, default to "Untitled Song". If an invalid value is passed for the duration of a song, default to 5 minutes. A Song should also support the following behaviors: compareTo() - Songs should be compared to each other based on their like factor A song's like factor is the difference between its number of likes and number of dislikes equals() -Should override Object's equals() method -A Song is equal to another Song if they have the same title, duration, likes, and dislikes. toString() Returns String in the format: {title}, Duration: (duration), Likes: (likes), Dislikes: {dislikes} Getter and setter methods for instance variables as required. For setters, note that if an invalid value is passed in, you should not modify the value of the instance variable. Any additional methods required to satisfy the interfaces Song implements.
Problem Description: Greetings aspiring music enthusiasts! You have been recruited by a top music streaming service to develop a cutting-edge music player application! Your mission is to create an app that allows users to
manage their playlists and listen to their favorite tunes.
The Challenge: The music industry faces a critical challenge – users crave a personalized and engaging
way to experience their favorite tunes! Your mission is to create an innovative application that goes
beyond basic playback.
Your Objectives: Develop the Maestro’s Toolkit: Define a robust music player which involves Users, Playlists,
and Songs. Each user will be able to create and manage their personal music collections using Playlists, which have a variety of Songs.
Craft the Perfect Symphony: Implement functionalities that make your music player stand out!
- Seamless Playlist Management: Users should be able to create or delete Playlists. Additionally, the functionality to customize existing Playlists is crucial.
- Curated Listening Experience: Let Users express their preferences through like and dislike functionality on both Playlists and Songs. Additionally, we want to allow Users to customize their Playlist with features like selecting the top and worst Song in the Playlist.
- Advanced Music Control: Users should be able to “play” and “pause” songs on demand.
By successfully completing this mission, you'll not only develop valuable programming skills, but you'll
also establish yourself as a legendary Music Maestro, crafting extraordinary musical experiences for all!
Solution Description: In the interest of encapsulation, data members for the following class should only be
accessible from other classes using getters and/or setters where needed. The described methods and
constructors for this assignment should be public. It is OK to write private helper methods. When you write your
solution, you’ll need to exactly match the instance variable names listed in this document. Further, your
Strings should exactly match our expected format. Minor discrepancies, including whitespace and
punctuation issues, can result in failed test cases.
- The String formats in the PDF sometimes wrap to another line due to their length -- you are not
expected to include newline characters in them.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 6 images