Question
You are given a two-dimensional array of values that specify the height of a terrain at different points in a square. Write a Java program
You are given a two-dimensional array of values that specify the height of a terrain at different points in a square. Write a Java program with the following tasks:
A method to read the heights of all the points of a terrain and store them into the two-dimensional array. You can assume that the heights are integer values
. Constructor of the class
A method to find the lowest point of the terrain.
A method to find the highest point of the terrain.
A method to print out a flood map, showing which of the points in the terrain would be flooded if the water level was a given value. In the flood map, print a * for each flooded point and a for each point that is not flooded. Here is a sample map for a 5 by 5 square:
* * - * -
* - - * *
* * * * *
- - * - *
* * - - -
Test your implemented class using a 4 by 4 squared terrain. Note: Your main class should work for squared terrains with any size.
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