Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Objective Given the header file Song.hpp. Song holds a songs name, artist, album, duration (in seconds) and whether or not it contains explicit lyrics. Complete
Objective
Given the header file Song.hpp. Song holds a songs name, artist, album, duration (in seconds) and whether or not it contains explicit lyrics.
Complete the implementation of this class using c++.
Functions needed:
- Song Constructor - This should initialize all Song member variables.
- Song Getters - name, artist, album, minutes, seconds and explicit lyrics should all be returned with these member functions. Keep in mind the duration in seconds is stored. The minutes() and seconds() getters should return the minutes and leftover seconds of a song. For example a song with a duration of 291 seconds should return 4 minutes and 51 seconds.
Skeleton Code for Song.hpp
#pragma once | |
#include | |
class Song { | |
private: | |
std::string name_; | |
std::string artist_; | |
std::string album_; | |
unsigned int duration_; | |
bool explicit_lyrics_; | |
public: | |
Song(std::string, std::string, std::string, unsigned int, bool); | |
std::string name(); | |
std::string artist(); | |
std::string album(); | |
unsigned int minutes(); | |
unsigned int seconds(); | |
bool explicit_lyrics(); | |
}; |
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