Question: Please write it in C++ Important requirements for all questions: No global variable is allowed to be declared and used. Constants are ok. Functions cannot

Please write it in C++
Important requirements for all questions:
No global variable is allowed to be declared and used. Constants are ok.
Functions cannot use cin or cout unless it is explicitly permitted. It should
make use of parameters and return value instead. cin and cout should be done
in main() or any testing functions
Multiple return statements in one function are not allowed.
The function cannot use the string class or string functions such as strlen. It
should only manipulate C-string as an array of chars with NULL at the end.
Please clearly show how you test your functions with at least the provided test
data
 Please write it in C++ Important requirements for all questions: No

3. Write a function named "isIncrementingBy1" that accepts an array of integers and its size. It will go through the array and return true if every element in the array has the value of the previous element +1 such as an array of {1,2,3,4} or {10,11,12,13,14}. It returns true if the array has only one element. It returns false otherwise. In addition, it also returns another flag indicating whether the array contains only non-zero positive numbers or not. You can assume that the array has at least one element. For example, the following arrays and their expected return values

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!