Fix bugs

Report a typo

The function printInfo() of the Bus class should print Type of bus: Personal, model: N4, speed: 130, but now it works incorrectly.

Fix the bugs in the code below.

Write a program in Kotlin
class Car(model: String, speed: Int)

class Bus(val typeOfBus: String, model: String, speed: Int) : Car(model, speed) {
fun printInfo() = println("Type of bus: $typeOfBus, model: $model, speed: $speed")
}

fun main() {
val bus = Bus("Personal", "N4", 130)
bus.printInfo()
}
___

Create a free account to access the full topic