1. Create the Trail class. Your class will include an array of integers that will use...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1. Create the Trail class. Your class will include an array of integers that will use the following elevation values using the index as the marker. Trail Elevation (meters) Index 0 1 2 3 4 5 6 7 8 9 10 11 12 Elevation 100 150 105 120 90 80 50 75 75 70 80 90 100 Your Trail class must include a constructor that has two integer values start and end which will represent where you will start and end on the Trail. Your class must include two methods, The first method is TrailLevel will return true if the difference between the maximum and minimum elevation on the Trail is less than or equal to 10 meters. Your second method is Trail Difficult will return true If the Trail is determined to be difficult and false If not. To determine if the Trail is difficult you must track elevation changes that greater than or equal to 30 meters between two consecutive markers, A trail with 3 or more such changes is rated as difficult. FOR EXAMPLE: A trail segment starting at marker 7 and ending at marker 10 has a minimum elevation of 70 meters and maximum elevation of 80 meters. Since the difference between the minimum and maximum elevation is less than or equal then 10 meters, this trail segment is considered level and should return true. A trail segment starting at marker 2 and ending at marker 12 has a minimum elevation of 50 meters and a maximum elevation of 120 meters, Since the difference between the minimum and maximum elevation is greater than 10 meters, this trail segment is not considered level and should return false. 1. Create the Trail class. Your class will include an array of integers that will use the following elevation values using the index as the marker. Trail Elevation (meters) Index 0 1 2 3 4 5 6 7 8 9 10 11 12 Elevation 100 150 105 120 90 80 50 75 75 70 80 90 100 Your Trail class must include a constructor that has two integer values start and end which will represent where you will start and end on the Trail. Your class must include two methods, The first method is TrailLevel will return true if the difference between the maximum and minimum elevation on the Trail is less than or equal to 10 meters. Your second method is Trail Difficult will return true If the Trail is determined to be difficult and false If not. To determine if the Trail is difficult you must track elevation changes that greater than or equal to 30 meters between two consecutive markers, A trail with 3 or more such changes is rated as difficult. FOR EXAMPLE: A trail segment starting at marker 7 and ending at marker 10 has a minimum elevation of 70 meters and maximum elevation of 80 meters. Since the difference between the minimum and maximum elevation is less than or equal then 10 meters, this trail segment is considered level and should return true. A trail segment starting at marker 2 and ending at marker 12 has a minimum elevation of 50 meters and a maximum elevation of 120 meters, Since the difference between the minimum and maximum elevation is greater than 10 meters, this trail segment is not considered level and should return false.
Expert Answer:
Related Book For
Posted Date:
Students also viewed these databases questions
-
CANMNMM January of this year. (a) Each item will be held in a record. Describe all the data structures that must refer to these records to implement the required functionality. Describe all the...
-
Python and most Python libraries are free to download or use, though many users use Python through a paid service. Paid services help IT organizations manage the risks associated with the use of...
-
1. Suppose that a particle moves along a straight line with acceleration a(t) =-6t+2 meters per second per second at time t seconds. Suppose that we fix the positive direction as motion to the right,...
-
The following income statements were provided by Chisholm Company, a wholesale food distributor: 2012 2011 Sales .....................................................$1,700,000 ............$1,500,000...
-
Fill in the blanks with an appropriate word, phrase, or symbol(s). Rational numbers such as and are examples of __________ numbers. 1}
-
When the plaintiff was 16, he was employed by Kmart as a cashier. At the end of his training, he was required to read Kmarts policy agreement, which included an agreement to submit all employment...
-
On January 29, Quality Marble Inc., a marble contractor, issued for cash 75,000 shares of $10 par common stock at $23, and on May 31, it issued for cash 100,000 shares of $4 par preferred stock at...
-
Describe persistence design under NoSQL technologies.? What is NoSQL polyglot persistence?
-
The area of the surface of a sphere is described by the formula S = 4r 2 , where r is the radius of the sphere. The Earth has a radius of 3960 miles and dry landforms approximately 29.2% of the...
-
An American firm owes A$1,500,000.00 payable in one year. The current spot it$1.7500/A$. An Australian bank is paying 4.50% on deposits or will lend at 7.50%. A U.S. bank is paying 2.50% or will lend...
-
Surveying leaders on strategic planning has shown respondents indicate- despite effective planning and good implementation the results/benefits of strategic planning it did not meet expectations....
-
Suppose that 4% of desktop computers run the Linux operating system (L). Suppose 2 computers are randomly selected (assume independence). (a) Find the probability that neither computer is running...
-
The CEO of Aaron's Auto Parts Supply would like to know whether his financial managers can pay off claims of short-term creditors without selling inventory. What ratio will help him understand the...
-
Based on the above calculations, your estimated 3 month expenses will be $4,200. If this is more than the total amount that Welcome Corps requires for your selected family size, $7,275, what is your...
-
A vehicle of mass 3000 %& is travelling at 55 %(/h. a. Calculate the kinetic energy of the vehicle. b. How far would the vehicle travel on a level road against a frictional resistance of 1.2 %5?...
-
Find the cross product a x b and verify that it is orthogonal to both a and b. a = (t, 1, 1/t), b = (t 2 , t 2 , 1)
-
Solve the linear programming model formulated in Problem 50 for Metro Food Services Company by using the computer. a. If Metro Food Services could hire another worker and increase its available...
-
For the demand data in Problem 11, develop a seasonally adjusted forecast for year 4. (Use a linear trend line model to develop a forecast estimate for year 4.) Which forecast model do you perceive...
-
In the Fast Shop Market example in this chapter, Alternative II was to add a new checkout counter at the market. This alternative was analyzed using the single-server model. Why was the...
-
Management is considering three alternatives to satisfy an urgent need. Each of the alternatives will completely satisfy the need, so no combinations have to be considered. The first costs, operating...
-
Consider the following cash flow profile and assume MARR is 10 percent/year and the finance rate is 4 percent/year. a. Determine the MIRR for this project. b. Is this project economically attractive?...
-
Consider the following cash flow profile and assume MARR is 10 percent/year and the finance rate is 4 percent/ year. a. Determine the MIRR for this project. b. Is this project economically...
Study smarter with the SolutionInn App