Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
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 (1 point)

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 (1 point)
selected by
...