fun main() {
val putin = Student("Путин", arrayOf(9.7777,8.6666,9.5));
println(putin.average());
}
class Student(private val _name:String,private val _grades:Array){
fun average():String{
return "Студент $_name имеет средний балл " +
"${
if(_grades.isEmpty()) 0
else "%.2f".format(_grades.map{(it.toDouble())}.average())
}";
}
}