- 1

Help me

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

24th Apr 2021, 12:38 PM
App
App - avatar
9 Answers
+ 3
A year is 365 days. The family is using 15L a day So if your input is 10 years your equation would be: (15*365)*10 15L every day for 365 day (a year) by 10 years
24th Apr 2021, 12:44 PM
Dexter Roderick
Dexter Roderick - avatar
+ 3
What is your problem? Show your attempt at solving a problem.
24th Apr 2021, 1:10 PM
Solo
Solo - avatar
+ 1
what if it's a leap year? what should he do then?
24th Apr 2021, 2:46 PM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
+ 1
maybe... the problem was not so easy...
24th Apr 2021, 2:55 PM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
+ 1
we also need to take into account which calendar is used? for example, the lunar calendar or the Mayan calendar. maybe there are no leap years at all?
24th Apr 2021, 3:04 PM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
0
Maybe there would be a date() check to see how many years until the next leap year? I don't really know, I'm still pretty new
24th Apr 2021, 2:53 PM
Dexter Roderick
Dexter Roderick - avatar
0
Yaroslav, what about 364.25 for each year?
24th Apr 2021, 2:58 PM
Dexter Roderick
Dexter Roderick - avatar
0
😁👍
24th Apr 2021, 3:00 PM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
0
since a leap year is repeated every four years, then for a period of five years, the leap year will occur once. right?
24th Apr 2021, 3:02 PM
Yaroslav Vernigora
Yaroslav Vernigora - avatar