Answer:
Answered below
Step-by-step explanation:
//The designs are implemented in Kotlin.
//Book class
class Book (val title: String,
val type: String,
val numberOfPages: Int,
val author: String ,
val yearPublished: Int ) {
fun bookDescription( ){
print("Book title is $title. Written
by $author and published
in $yearPublished" )
}
}
//Driver class
class Main {
fun main( ) {
val novel: Book = Book("Animal Farm", "novel", 200, "Orwell", 1990 )
println(novel.title)
println(novel.author)
val description = novel.bookDescription( )
println(description)
val magazine: Book = Book("Forbes", "magazine", 50, "Michael", 1995)
}
}