diff --git a/src/task1.kt b/src/task1.kt new file mode 100644 index 0000000..0d140bc --- /dev/null +++ b/src/task1.kt @@ -0,0 +1,20 @@ +fun main() { + + var book = Book() + book.title ="Harry Potter" + book.author="Jk Rowing" + book.yearPublished=2000 + book.printBook() +} + + +class Book{ + var title: String="" + var author: String="" + var yearPublished: Int=0 + + fun printBook(){ + println("Title: "+title+" Author: " +author ) + } + +} \ No newline at end of file diff --git a/src/task2&3.kt b/src/task2&3.kt new file mode 100644 index 0000000..79e0307 --- /dev/null +++ b/src/task2&3.kt @@ -0,0 +1,18 @@ +fun main() { + + var newBook = Book2("Harry Potter", "Jk Rowing", 2000) + + newBook.printBook() + +} + + + +class Book2(var title:String,var author: String, var yearPublished:Int ){ + + + fun printBook(){ + println("Title: "+title+" Author: " +author ) + } + +} \ No newline at end of file