Computer Science, asked by techquantifier099, 1 month ago

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 deepqnkar
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