Squashed 'Programming/ProgLab6/' content from commit 3e98b8e

git-subtree-dir: Programming/ProgLab6
git-subtree-split: 3e98b8e205b1a576c861f90028b198d5052a79c3
This commit is contained in:
LeterZP
2026-05-17 15:29:12 +03:00
commit 1d57fb83a4
62 changed files with 2722 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
package elements
import exceptions.InvalidElementValueException
import kotlinx.serialization.Serializable
/**
* Человек для города [City].
*
* @param name
* @param age
* @param height
*/
@Serializable
class Human(private val name: String, private val age: Long, private val height: Float) {
init{
if (name == "") throw InvalidElementValueException(name)
if (age <= 0) throw InvalidElementValueException(age)
if (height <= 0) throw InvalidElementValueException(height)
}
override fun toString(): String {
return "$name, возраст $age, рост $height"
}
}