- 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
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
+ 3
What is your problem?
Show your attempt at solving a problem.
+ 1
what if it's a leap year? what should he do then?
+ 1
maybe... the problem was not so easy...
+ 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?
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
0
Yaroslav, what about 364.25 for each year?
0
đđ
0
since a leap year is repeated every four years, then for a period of five years, the leap year will occur once. right?