mardi 5 février 2019

How would i shorten this if statement to only make it one line?

How could I shorten this if statment to make the code look more clean (preferably to one line)

    public string GetCertification()
    {
        if (copiesSold < 200000)
        {
            return null;
        }
        if (copiesSold < 400000)
        {
            return "Silver";
        }
        if (copiesSold < 600000)
        {
            return "Gold";
        }
        return "Platinum";
    }
}

}

Aucun commentaire:

Enregistrer un commentaire