Question: JavaScript Question 3 (See Information Panels #1 and #2 above). Write as an instance method and include its complete signature. Write the Trail method isDifficult.
JavaScript

Question 3 (See Information Panels #1 and #2 above). Write as an instance method and include its complete signature. Write the Trail method isDifficult. A trail is rated by counting the number of changes in elevation that are at least 30 meters (up or down) between two consecutive markers. A trail with 3 or more such changes is rated difficult. The following table shows trail elevation data and the elevation changes between consecutive trail markers. Index 0 1 Trail Elevation (meters) 23 4 5 6 7 105 120 90 80 50 75 8 9 10 11 12 Elevation 100 150 75 70 80 90 100 Elevation change 50 -45 15 -30 -10 -30 25 0 5 10 10 10 This trail is rated difficult because it has 4 changes in elevation that are 30 meters or more (between markers 0 and 1, between markers 1 and 2, between markers 3 and 4, and between markers 5 and 6). Complete method isdifficult below. /** Determines if this trail is difficult. A trail is rated by counting the number of changes in elevation that are at least 30 meters (up or down) between two consecutive markers. A trail with 3 or more such changes is rated difficult. @return true if the trail is rated difficult; false otherwise. public boolean isdifficult() *
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
