Paul Clapham wrote:Hi jaedon, welcome to the Ranch!
You're right that it's simple (or fairly simple, anyway). So let's start: what part of the code do you think is calculating the highest value? You'd need to change that code to calculate the lowest value.
Campbell Ritchie wrote:Go through the code carefully. You are not far out, but 30 and 31 isn't correct. If you are seeking the minimum, you will want to write a new method with max changed to min throughout.
I have never thought that simply reading code is a good way to learn programming. I suggest you go through the method to find a maximum value and read out what the code says. Read it aloud. I hope that will make it easier to understand.
jaedon nixon wrote:. . . teacher hands us this and we copy it out. im getting lost . . .
Campbell Ritchie wrote:I have never thought that simply reading code is a good way to learn programming... Needed one more )
Lombe Chileshe wrote:Hi Jaedon, I'll try to walk you through the
Line 30 in the original code. You have a second variable which is completely separate but has the same name in line 23.
jaedon nixon wrote:. . . point out where max is defined . . .
That's a pleasure
jaedon nixon wrote:. . . thank you . . .
That is what the forum is for. I am pleased that you worked it out; please show us your solution.
sorry for all the questions . . .
jaedon nixon wrote:See but i don't completely understand the code, basically teacher hands us this and we copy it out. im getting lost when im trying to understand the code.
jaedon nixon wrote:I figured it out, and I think i understand the code a bit more now...
Always look on the bright side of life. At least this ad is really tiny:
Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Appshttps://coderanch.com/t/722574/Sauce-Labs-World-Largest-Continuous