QUESTION 2 1) Write a maxConsecutiveDiff function which returns the maximum difference between any two consecutive values in the array. Consecutive values are next to each other in an array (+/- 1 index) This function should accept all required data as parameters. Examples If the array is 17 15 16 11 14 the maximum consecutive difference is 5 which is the difference between 16 and 11. If the array is 10 13 11 12 19 the maximum consecutive difference is 7 which is the difference between 12 and 19.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter7: Arrays
Section: Chapter Questions
Problem 12PP: (Data processing) The answers to a true-false test are as follows: T T F F T. Given a twodimensional...
icon
Related questions
Question

Note: It`s C++ coding

QUESTION 7
1) Write a maxConsecutiveDiff function which
returns the maximum difference between any two
consecutive values in the array.
Consecutive values are next to each other in an
array (+/- 1 index)
This function should accept all required data as
parameters.
Examples
If the array is 17 15 16 11 14 the maximum consecutive
difference is 5 which is the difference between 16 and
11.
If the array is 10 13 11 12 19 the maximum consecutive
difference is 7 which is the difference between 12 and
19.
Transcribed Image Text:QUESTION 7 1) Write a maxConsecutiveDiff function which returns the maximum difference between any two consecutive values in the array. Consecutive values are next to each other in an array (+/- 1 index) This function should accept all required data as parameters. Examples If the array is 17 15 16 11 14 the maximum consecutive difference is 5 which is the difference between 16 and 11. If the array is 10 13 11 12 19 the maximum consecutive difference is 7 which is the difference between 12 and 19.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 6 steps with 5 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning