Kotlin is a modern programming language that is designed to be both functional and object-oriented. One of…