-
Notifications
You must be signed in to change notification settings - Fork 178
/
Copy pathday 02.kt
40 lines (32 loc) · 1015 Bytes
/
day 02.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import java.io.*
import java.math.*
import java.security.*
import java.text.*
import java.util.*
import java.util.concurrent.*
import java.util.function.*
import java.util.regex.*
import java.util.stream.*
import kotlin.collections.*
import kotlin.comparisons.*
import kotlin.io.*
import kotlin.jvm.*
import kotlin.jvm.functions.*
import kotlin.jvm.internal.*
import kotlin.ranges.*
import kotlin.sequences.*
import kotlin.text.*
// Complete the solve function below.
fun solve(meal_cost: Double, tip_percent: Int, tax_percent: Int): Unit {
val tip:Double = meal_cost*(tip_percent.toDouble()/100);
val tax:Double = meal_cost*(tax_percent.toDouble()/100);
val totalCost:Double = meal_cost + tip + tax;
print(Math.round(totalCost));
}
fun main() {
val scan = Scanner(System.`in`)
val meal_cost = scan.nextLine().trim().toDouble()
val tip_percent = scan.nextLine().trim().toInt()
val tax_percent = scan.nextLine().trim().toInt()
solve(meal_cost, tip_percent, tax_percent)
}