Question: C++ #include using namespace std; bool isLevelTrailSegment(int markers[],int Start, int End); bool isDifficult(int markers[],int Start, int End); int main() { const int SIZE=13; int markers[SIZE]={100,150,105,120,90,80,50,75,75,70,80,90,100};

 C++ #include using namespace std; bool isLevelTrailSegment(int markers[],int Start, int End);

bool isDifficult(int markers[],int Start, int End); int main() { const int SIZE=13;

C++

#include  using namespace std; bool isLevelTrailSegment(int markers[],int Start, int End); bool isDifficult(int markers[],int Start, int End); int main() { const int SIZE=13; int markers[SIZE]={100,150,105,120,90,80,50,75,75,70,80,90,100}; bool isLevel; bool difficult; int Start=7, End=10; cout 

A hiking trail has elevation markers posted at regular intervals along the trail. Elevation information about a trail can be stored in an array, where each element in the array represents the elevation at a marker. The elevation at the first marker wil be stored at array index 0, the elevation at the second marker wil be stored at array index 1, and so forth. Elevations between markers are ignored in this question. The graph below shows an example of trail elevations. TRAIL ELEVATION 160 140 120 100 60 20 0123456 789 10 11 12 Index The table below contains the data represented in the graph. Trail Elevation (meters) 023 56 7 910 1 12 100 150 105 12090 0 50 15 15 0 0 90 100 Index Elevation (a) Declare the markers array to have the int values shown above. Write the Trail function isLevelTrailSegment. A trail segment is defined by a starting marker, an ending marker, and all markers between those two markers. The parameters of the function are the index of the starting marker and the index of the ending marker. The function will return true f the difference between the maximum elevation and the minimum elevation in the trail segment is less than or equal to 10 meters. For the trail shown at the beginning of the question, the trail segment starting at marker 7 and ending at marker 10 has elevations ranging between 70 and B0 meters. Because the difference between 80 and 70 is equal to 10, the trail segment is considered level. The trai segment starting at marker 2 and ending at marker 12 has elevations ranging between 50 and 120 meters. Because the difference between 120 and 50 is greater than 10, this trail segment is not considered level. Determines if a trail segment is level. A trail segment is defined by a starting marker an ending marker, and all markers between those two markers A trail segment is level if it has a difference between the maximum elevation and minimum elevation that is less than or equal to 10 meters. @param markers, the aray of markers

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!