Area printer

Report a typo

Assume you have the Rectangle class with width and height properties. The properties types are Int.

Implement a function that receives a Rectangle object and prints the product of the multiplication of two properties. Name the function printArea.

Write a program in Kotlin
class Rectangle {
var width: Int = 0
var height: Int = 0
}

fun printArea(rectangle: Rectangle) {
// ...
}
___

Create a free account to access the full topic