From 27ec4edb52f0b6bb78f75eddfb09a7580096bd92 Mon Sep 17 00:00:00 2001 From: HAlGhanim Date: Sun, 16 Feb 2025 18:33:41 +0300 Subject: [PATCH] Done with the task and challenge --- .idea/misc.xml | 2 +- src/Main.kt | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 03f397c..10a22f9 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/src/Main.kt b/src/Main.kt index a7a5e00..2669565 100644 --- a/src/Main.kt +++ b/src/Main.kt @@ -1,3 +1,10 @@ fun main() { - println("Hello World!") + val hannibal = Book("The Silence of the Lambs", "Thomas Harris", 1988, "Thriller") + hannibal.printBookInfo() +} + +class Book(var title: String, var author: String, var yearPublished: Int, var genre: String) { + fun printBookInfo() { + println("$title By $author ($yearPublished)\nGenre: $genre") + } } \ No newline at end of file