Application

Report a typo

John and Nick have their own rooms. You need to write type aliases named johnArea and nickArea to get the area of their rooms and return the total area of the rooms in function findTotalArea(). It is known that the area of John's room is 40 and the area of Nick's room is 60.

Write a program in Kotlin
class John {
class JohnApartment(sizeOfRoom: Int) {
val size: Int = sizeOfRoom
}
}

class Nick {
class NickApartment(sizeOfRoom: Int) {
val size: Int = sizeOfRoom
}
}

fun findTotalArea(): Int {
// return the total area
}
___

Create a free account to access the full topic