Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Making Databases Work The Pragmatic Wisdom Of Michael Stonebraker

Authors: Michael L. Brodie

1st Edition

1947487167, 978-1947487161

More Books

Students also viewed these Databases questions

Question

c. What were you expected to do when you grew up?

Answered: 1 week ago

Question

4. Describe how cultural values influence communication.

Answered: 1 week ago

Question

3. Identify and describe nine cultural value orientations.

Answered: 1 week ago