Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I would like to know what I did wrong. ethod to draw the mountain range Create the drawMountains method. This method takes as the first
I would like to know what I did wrong.
ethod to draw the mountain range Create the drawMountains method. This method takes as the first parameter an array of doubles, which is the height of the points in the mountain range. The second parameter is a String, which represents the symbol to draw the mountains with. First, we need to find the tallest point in the mountain range. Call the findMaxHeight method with the mountain range. Take the returned value, add one, and then cast it to an integer. We want this marimum height to be an integer such that we can use nested for-loops to draw a grid of symbols representing the mountains Second, use nested for-loops (like in the last warm-up question) to draw the mountains. The outer for-loop should loop from the maximum height, down to zero. The inner for-loop should loop from the beginning of the points array to the end. The iteration variables for the for-loops provide the coordinates to decide whether to draw sky, ground or the mountain symbols. See the table for more details Let y be the vertical component of the grid you are drawing, and let height be the height of the current point. Condition y > height y - height -1 The mountaintop yStep 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