Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

c++ Write a predicate function called isStrictlyIncreasing that checks whether a

ID: 3929931 • Letter: C

Question

c++

Write a predicate function called isStrictlyIncreasing that checks whether an array of integers contains values that are in strictly increasing order. A declaration of the function is shown above. The function returns true if the elements are in strictly increasing order; otherwise it returns false. For example, it will return true for (-2, 4, 5, 6, 8) and it will return false for (3, 4, 6, 6, 9). Write test code that tests every statement in the function. Use assertions in your test code. Hint: Compare a[i] with a[i + 1] and remember to stop at i = n - 1 so you don't access a value past the end of the array.

Explanation / Answer

bool isStrictlyIncreasing(int a[], int len)

                   (or)

for (int i = 0; i < v.size() - 1; ++i)

{

if (v[i] >= v[i + 1]) return false;

}

return true;

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote