#Help with mission

1 messages · Page 1 of 1 (latest)

sterile obsidianBOT
#

Hey, @tight oar!
Please remember to /close this post once your question has been answered!

cerulean ivy
#

@tight oar how about storing the temps into a list, and then iterating over the list and getting the differences; if the difference is positive (warmer) then put it into a list for example

#

also why is the output 3, 4, 7 for 25,22,26,27,27,23,29? i sort of don't get the question

#

25-22 is 3 (cooler), 27-23 is 4 (cooler), but what's the 7 for? and isn't it asking about warmer days?

tight oar
cerulean ivy
#

oh 3, 4, 7 are the days that were warmer, sorry i get it now

#

ok so store temps into a list of temps (for example), iterate over temps, and if day i's temp was cooler than i+1's temp, add i+1 to a list of warmerDays, then at the end just print the warmerDays list

tight oar
soft token
#

I guess you could save it as a String[], and do it that way. But most of academia isn't about coding, per se, and more about problem solving.

For example, you could solve 2 + 2 = 4 as 1 + 1 + 1 + 1 or 2 + 2 or 2 + 1 + 1 or 3 + 1.

You're going to get the same answer regardless, but if your teacher wants you to do 1+1+1+1 instead of 2+2 to get 4, it would benefit you more to figure that out on your own. I mean that in earnest.

cerulean ivy