From 6f123689f72ceca22d83d93430a1e42b1cf2eb7b Mon Sep 17 00:00:00 2001 From: alrweashd Date: Sun, 16 Feb 2025 18:30:54 +0300 Subject: [PATCH] done with the challenge --- .idea/jpa-buddy.xml | 6 ++++++ .idea/kotlinc.xml | 6 +----- .idea/misc.xml | 3 +++ src/Main.kt | 18 ++++++++++++++++++ 4 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 .idea/jpa-buddy.xml diff --git a/.idea/jpa-buddy.xml b/.idea/jpa-buddy.xml new file mode 100644 index 0000000..966d5f5 --- /dev/null +++ b/.idea/jpa-buddy.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml index 8226e53..36b41ec 100644 --- a/.idea/kotlinc.xml +++ b/.idea/kotlinc.xml @@ -1,10 +1,6 @@ - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 03f397c..f8ed9c1 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,4 +3,7 @@ + + \ No newline at end of file diff --git a/src/Main.kt b/src/Main.kt index a7a5e00..dd6e14a 100644 --- a/src/Main.kt +++ b/src/Main.kt @@ -1,3 +1,21 @@ fun main() { println("Hello World!") + val myBook = Book("World War 2","Turki",2025, "History"); + + println("myBook $myBook") + println(myBook.getBookInfo()) + +} +class Book(var title: String, + var author: String, + var yearPublished: Int, + var genre: String) { + + override fun toString(): String { + return "Title: $title, Author:$author, Year: $yearPublished" + } + fun getBookInfo():String { + return "$title by $author ($yearPublished) genre: $genre" + } + } \ No newline at end of file