Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/main/kotlin/mate/academy/BuyProducts.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
package mate.academy

fun getTotalPriceMessage(client: String, price: Int, quantity: Int): String {
return ""
val totalCost = price * quantity

return "$client has to pay $$totalCost per $quantity products"
}

fun main() {
val client1 = "Mary"
val price1 = 30
val quantity1 = 3
println(getTotalPriceMessage(client1, price1, quantity1))

val client2 = "Bob"
val price2 = 15
val quantity2 = 5
println(getTotalPriceMessage(client2, price2, quantity2))
}
Loading