Final answer:
The Song class needs private data members and public methods, while the MusicPlayer should also maintain private data members and provide public methods for functionality. Test in the main function involves creating a MusicPlayer, adding songs, and testing its methods.
Step-by-step explanation:
The Song class should be designed with private member variables to encapsulate its data, ensuring data integrity and providing control over the values. Public methods should be provided for external interaction with these members, such as getters and setters, and to facilitate specific functionality like displaying the song details. The constructor should be public for creating Song objects.
The MusicPlayer class would also hold private data members to maintain the encapsulation principle of OOP. Public methods should include those that allow interaction with the music player, such as play, next, previous, add, remove, and print. Getters and setters can be provided for member variables where external access or modification is necessary, but careful consideration should be given to whether allowing such access is appropriate for each specific member.
When writing the test in the main function, it involves creating an instance of MusicPlayer, adding songs to it, and testing the functionality of various methods such as play, next, previous, add, remove, and print, as per the requirements stated in the assignment.