Question: Write a method that will take in a double as a parameter and will return the square root of the number. However, if the number
Write a method that will take in a double as a parameter and will return the square root of the number. However, if the number is negative, throw an exception with the message "Error. Cannot find the square root of a negative number." (Recall that there is a method called Math.sqrt(). You do not have to write your own square root method.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
