Question: (java) A specification for a procedure that computes the sum of the elements in an array of integers might 1) require a nonempty array, 2)
(java)
A specification for a procedure that computes the sum of the elements in an array of integers might 1) require a nonempty array, 2) return 0 if the array is empty, or 3) throw an exception if the array is empty. Discuss which one of three alternatives is best and provide the specification for the procedure.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
