Water Consumption
In kotlin
Each day a family consumes 15 liters of water.
Given the number of years as input, you need to calculate and output the amount of water consumed in that period.
Sample Input
5
Sample Output
27375
The water consumption in 5 years would be: 5*365*15 = 27375
Use 365 as the number of days in a year.
Answers
Answered by
0
Answer:
You cannot declare variable starting with capital letter.
var years = readLine()!!.toInt() => [means it's going to take input and convert into integer]
When you are taking input, you don't need to assign consumption value of water. Here, you have to year [not consumption]
You can solve it this way & it will give you correct output. ⬇️
var years = readLine()!!.toInt()
println(years*365*15)
//try to understand logic behind given problem. It will be easy to solve other problems
Similar questions
Math,
17 days ago
Math,
17 days ago
Biology,
17 days ago
Social Sciences,
8 months ago
English,
8 months ago