I have went to so many places online but can't find anything that explains overloading constructors well. I am justlooking for some guidance
I have to Overload the constuctor in my song class to allow a song to be created without providing a value for copiesSold.
class Song
{
string name;
string artist;
int copiesSold;
public Song(string name, string artist, int copiesSold)
{
this.name = name;
this.artist = artist;
this.copiesSold = copiesSold;
}
public Song()
{
}
public string GetArtist()
{
return artist;
}
public string GetDetails()
{
return $"Name: {name} Artist: {artist} Copies Sold: {copiesSold},";
}
public string GetCertification()
{
if (copiesSold < 200000)
{
return null;
}
if (copiesSold < 400000)
{
return "Silver";
}
if (copiesSold < 600000)
{
return "Gold";
}
return "Platinum";