Home /
Expert Answers /
Computer Science /
code-in-c-please-define-a-function-checkselectivesum0-that-has-one-integer-vector-parameter-and-pa892
(Solved):
code in c++ please
Define a function CheckSelectiveSum0 that has one integer vector parameter and ...
code in c++ please
Define a function CheckSelectiveSum0 that has one integer vector parameter and one integer parameter. The function computes the sum of the vector's elements that are not equal to the integer parameter. Then, the function returns true if the sum is zero, and returns false otherwise. Ex: If the input is \( 4-61-210-2 \), the vector has 4 elements \( \{-6,1,-2,10\} \), and the integer parameter is \( -2 \). Then, the output is: False, the sum of the elements that are not equal to \( -2 \) is not zero. Note: The sum is zero if all elements are equal to the integer parameter.