Kyaria icon

Song

Kyaria | PRO | 05/23/19 01:22:58 PM UTC | 0 ⭐ | 10541 👁️ | Never ⏰ | []
Kotlin |

760 B

|

None

|

0 👍

/

0 👎

open class Song(val titel : String, val interpret : String, var spieldauer : Int, _bewertung : Int)
{
    var bewertung : Int = _bewertung
        set(value)
        {
            field = if(value in 0..100) value else 0
        }
 
    open fun abspielen()
    {
        val angMin : Int = if(spieldauer % 60 != 0)
            spieldauer / 60 + 1
        else
            spieldauer / 60
 
        for (i in 1..angMin )
        {
            println("Titel: $titel; Interpret: $interpret; Spieldauer: $spieldauer")
        }
    }
 
    fun changeBewertung(newBewertung : Int)
    {
        bewertung = newBewertung
    }
 
    open fun suche(begriff : String) : Boolean
    {
        return titel.contains(begriff) || interpret.contains(begriff)
    }
}

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎