Making a flowerbed

Report a typo

Correct the code below to make the program work properly.

Sample Input 1:

red rose

Sample Output 1:

This flowerbed has many red roses
Write a program in Kotlin
open class Plant(val name: String)

class Flower(val color: String) : Plant

class Flowerbed (val color: String, name: String) : Flower() {
fun print(){
println("This flowerbed has many $color ${name}s")
}
}

Create a free account to access the full topic