OOP_IO-2x_2023-mirror/Java/lab_4/Furniture.kt

11 lines
543 B
Kotlin
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package OOP.Java.lab_4
class Furniture(val name: String, val material: String, val price: Int, val length: Int, val width: Int, val height: Int) {
fun print(nameWidth: Int, materialWidth: Int, priceWidth: Int){
print("Furniture stats: {")
print("Name: ${this.name.padEnd(nameWidth)} ")
print("Material: ${this.material.padEnd(materialWidth)} ")
print("Price: ${(this.price.toString() + " cu").padEnd(priceWidth + 3)} ")
print("Size: ${this.length}×${this.width}×${this.height}};\n")
}
}