This method will take in an array of type double and return the minimum and maximum values. I wrote it to deal with temperature readings and to find the min/max for a week.

It will work with any number of array elements as it uses a foreach loop to iterate through the values and assign the smallest and largest values to a new array to be returned.

You might think it odd that I did not use an if-else block, but not using one is important because It allows the min and max to be the same value which would be required if all of the array elements are the same, with an if-else statement the second if statement would be passed over if the first evaluates to true.