Question: C++ Question I need to create a class that will classify music albums that will hold all of the important information for a single album.
C++ Question
I need to create a class that will classify music albums that will hold all of the important information for a single album.
All the member variables need to be protected using the private tag, which should include album name, artist, genre, release year, and publisher. The album will also hold a tracklisting of each song title and duration.
Constructor: The Album name, artist, release year, and publisher should all be set when the Album class is made (hint: this means you will need at least one constructor that has all of these). These variables should not change as the class is modified.
Each of these public methods must be implemented:
- A host of interfaces is needed to access all of the member variables: name, artist, genre, release, and publisher.
- A way to add tracks to the album, one at a time.
- A way to tell how many tracks are part of the album.
- A way to pull specific track information by track number (both track name and duration). This can be done in one method, or two.
- A way to report the total duration of the album.
- A way to print all of the album information (including track information and totals) to the terminal (this should be the only method with a COUT or CIN). This should be informative and well formatted.
Application: Your main function should utilize at least two instances of an album, fill each of them with tracks (at least 5 each) then display the use of each of the methods implemented. Show that your class is working and correct.
+10 pts Extra Credit: Make a class that represents a track, then replace the track listing member variables in your album class with an array of class track. This track should hold track name and duration at a minimum.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
