Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

we can use array (30 points) You are going to develop a class to represent Songs. *For the instance variables, add the below ones. Make

image text in transcribed

image text in transcribed

we can use array

(30 points) You are going to develop a class to represent Songs. *For the instance variables, add the below ones. Make sure that these values cannot be accessed from other classes. Name of the artist Name of the song Duration of the song(in seconds) Play count *Write at least two constructors (not the default one) (Hint: When you first create a song, play count should be 0) *For this class, make sure you follow the encapsulation rules. (Add methods that you think are necessary for encapsulation) *Add an additional play method that increases the play count. *Override the toString method. Return everything in a proper format. *Implement a class that will represent a Music Album that contains songs. *For the instance variables, add the below ones. Make sure that these values cannot be accessed from other classes. name of the album number of songs songs[] *Write at least two constructors (not the default one) *For this class, make sure you follow the encapsulation rules. (Add methods that you think are necessary for encapsulation) l-up and reports Participants More *Write at least two constructors (not the default one) *For this class, make sure you follow the encapsulation rules. (Add methods that you think are necessary for encapsulation) *Write one additional method to add songs to this album. *Write one additional method to search a song by the artist's name in this album. If you can find it, return it. *Write one additional method to search a song by the song name in this album. If you can find it, return it. *Write another method to decide the top song in this album which is the most played song and display it. *Override the toString method. Return everything including the song names. *Finally, use this class with a main method. Create a couple of songs. Then create an album with these songs. Play them randomly. Search the songs, call the necessary methods and at the end show us which song is the top song. The general flow is up to you but make sure you call search methods, play method, add method and tostring methods. WHEN YOU COPY PASTE YOUR CODE TO THE BELOW AREA, THE FORMAT SHOULD BE LIKE THIS COPY THE SONG CLASS (ADD THIS DASHES TO SEPERATE THE CLASSES) COPY THE ALBUM CLASS (ADD THIS DASHES TO SEPERATE THE CLASSES) COPY YOUR MAIN METHOD

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 Systems Introduction To Databases And Data Warehouses

Authors: Nenad Jukic, Susan Vrbsky, Svetlozar Nestorov

1st Edition

1943153191, 978-1943153190

More Books

Students also viewed these Databases questions

Question

Send to Gradebook

Answered: 1 week ago