Welcome to the CSC Q&A.
Get help and give help!
Write great code!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+17 votes

When it comes to finding minimums and maximums there are times, when there is only one or two observations, that the number for the maximum remains "Integer.Min_Value". I believe I am doing the conditions correctly within the if/else statements, but is my issue that that my conditional statements are "if/else if" opposed to "if/if"?

asked in CSC211_Winter2018 by (8 points)

1 Answer

+11 votes
 
Best answer

You should use "if/if" for these because, like you said, if there is only one observation then it is both the minimum and the maximum so you want it to go to the second if statement even if the first is true.

answered by (8 points)
selected by
...