From 7880f5126c13a4fd0ad20de2a82bf65e683e8602 Mon Sep 17 00:00:00 2001 From: vdsfww Date: Thu, 3 Jul 2025 16:42:53 +0300 Subject: [PATCH] hw --- build.gradle.kts | 4 ++-- src/main/kotlin/mate/academy/StoreService.kt | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 08780a4..4601a11 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - kotlin("jvm") version "1.8.0" + kotlin("jvm") version "2.1.0" application id("io.gitlab.arturbosch.detekt") version "1.23.3" } @@ -20,7 +20,7 @@ tasks.test { } kotlin { - jvmToolchain(11) + jvmToolchain(17) } detekt { diff --git a/src/main/kotlin/mate/academy/StoreService.kt b/src/main/kotlin/mate/academy/StoreService.kt index 7a053df..5d6c121 100644 --- a/src/main/kotlin/mate/academy/StoreService.kt +++ b/src/main/kotlin/mate/academy/StoreService.kt @@ -1,8 +1,12 @@ package mate.academy class StoreService { - // Function to update the store's stock with `with` fun updateStoreStock(store: Store, extraShoes: Int, extraShirts: Int, extraJackets: Int) { - // TODO: implement + with(store) { + store.shoes += extraShoes + store.shirts += extraShirts + store.jackets += extraJackets + store.printInventory() + } } }