Answered step by step
Verified Expert Solution
Link Copied!

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

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

More Books

Students also viewed these Databases questions

Question

Define organisational structure

Answered: 1 week ago

Question

Define line and staff authority

Answered: 1 week ago

Question

Define the process of communication

Answered: 1 week ago

Question

Explain the importance of effective communication

Answered: 1 week ago

Question

* What is the importance of soil testing in civil engineering?

Answered: 1 week ago