Question
Can some one teaches me these function please! I need a help. MyTunes Music organization software like iTunes provides users with a variety of ways
Can some one teaches me these function please! I need a help.
MyTunes
Music organization software like iTunes provides users with a variety of ways to display music. You will implement MyTunes, which will allow users a small section of normal music management options:
Ability to enter a new song
Ability to sort songs by album, then by track number
Ability to search for albums
In order to more easily store user input data, you will create a Song class by creating a header file and implementation file. The class should have four (private) data members:
Song name
Album name Artist name
Track number
The class should have getter and setter functions for each data member. Further, there should be two constructors. One constructor has no parameters and should set each data member to a default value of your choice. Another constructor should have four parameters (one for each data member) setting the four private members. Finally, there should be a print function, which does the following tasks.
prints an end-of-line character
prints the song name, left-aligned, among 22 spaces
prints the album name, left-aligned, among 22 spaces
prints the artist name, left-aligned, among 22 spaces
prints the track number, right-aligned, among 4 spaces You will then create a client file named MyTunes.cpp to implement the functionality described in the introduction. Here are details about the client code.
General I/O Comments o For input, use cin and when necessary, getline o For output, use cout
Main functionality is menu driven, specified below
o User interaction is guided via a menu, looping until the user enters 0 (see below).
o Entry 1 will be for adding a new song o Entry 2 will be for sorting the song list
o Entry 3 will be for searching the song list o Entry 4 will be for printing the song list
o Entry 0 will be for exiting the loop
o For any other entry, inform the user of the error and allow them to re-enter
Use cin to obtain the user entry o After the user enters the choice, call cin.ignore();
Implement menu interaction using at least one client function
Adding a new song
o ask the user for song name, album name, artist name, and track number
o enter data into a Song object and place at end of the array if space is available
o inform the user if the addition was successful or if it failed
o implement these requirements using one or more client functions
Sorting the song list
o You may assume that all album names are entered and stored in all upper-case letters
o The array of songs should be sorted in alphabetical order by album name
o For each album, the songs should also be sorted by track number in ascending order
o Once sorted, call the print function specified below
o implement these requirements using one or more client functions
Searching for an album
o Ask the user the name to search for (entries can be assumed to use upper-case letters)
o Ensure that the array is in sorted order
o Use binary search to locate the requested album
o If not found, inform user
o If found, list all songs in the album (Use print() from the Song class for each one)
o implement these requirements using one or more client functions
Printing the songs
o Print each song in the list. Each Song instance should call its class Print function
o Implement this requirement using a client function
o Optional: in my example outputs, notice that I have a formatted heading for the printed list. This is not a requirement, but it looks a little nicer and explicitly categorizes each column
11 function about >>1. Default Constructor ,2.Overloaded constructor,
3.GetSongName,4. SetSongName,
5.GetAlbumName, 6.SetAlbumName,
7.GetArtistName,8. SetArtistName,
9.GetTrackNumber,10. SetTrackNumber,
11.Song::printc {
cout< cout< cout<< ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cout<<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ EX. Song YMCA ( "YMCA" , "SONALPL" , "The VILLAGBPE" , "1" , YMCA.printc );
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