0
Why my output is incerect
My output is the same is the expected output so why my output is incerect . This is my code :class MusicPlayer { private var songs: Array<String> = arrayOf() //your code goes here fun add(valu: String ){ songs += valu } fun show(){ for (x in songs ){ println(x) } } fun play (){ println ("playng " + songs[0] ) } } fun main(args: Array<String>) { val m = MusicPlayer() while(true) { var input = readLine()!! if(input == "stop") { break } m.add(input) } m.show() m.play() }
1 Resposta
+ 5
Have a look at the spelling:
fun play(){
println("Playing "+songs[0])
Upper case "P" and a missing "i" in "Playing"