Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. Initialize an ArrayList with the following values: (43, 23, 12, 67, 90, 33, 45, 12} From the list: a. find the highest value
1. Initialize an ArrayList with the following values: (43, 23, 12, 67, 90, 33, 45, 12} From the list: a. find the highest value b. find the lowest value c. find the sum of all values d. find the average of the values Show the results. 2. Initialize an ArrayList by generate a list of random 100 double values. From the list: a. find the highest value b. find the lowest value c. find the sum of all values d. find the average of the values Show the results. 3. Write class MountainTrek that records the distance a mountaineer climbs every day. The distance is measured from the base camp up to the highest location the mountaineer climbed for that given day. The mountaineer sometimes would take a few days break to allow his body to recover from the climb (rest days colored yellow). The climb record is shown below. Climb record: Week Mo Tu We Th Fr Sa Sun 1 623 793 614 870 695 540 2 736 625 849 823 535 3 823 729 838 627 520 791 4 649 552 544 890 535 a. Assume that the climb record is a 2D array of integers that ranges from 500-900 inclusive. b. On a given week a climber may rest one(min) or two(max) days. c. Programming: create ArrayList record to hold the values from the 2D climb records. Note that the climb record values can be randomly generated using the range 500-900 inclusive. record: 623 793 614 870 695 540 736. 535 write method highest Pair() that returns the total of the highest paired consecutive values from record. write method lowest Pair() that returns the total of the lowest paired consecutive values from record. write method aveDiff() that returns an array of doubles of the difference of the average of record against all the values.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started