Question: You are given a two-dimensional array of values that give the height of a terrain at different points in a square. Write a method. that

You are given a two-dimensional array of values that give the height of a terrain at different points in a square. Write a method.

public static void floodMap (double[][] heights, double waterLevel)

that prints out a flood map, showing which of the points in the terrain would be flooded if the water level was the given value. In the flood map, print a * for each flooded point and a space for each point that is not flooded. 

Then write a program that reads one hundred terrain height values and shows how the terrain gets flooded when the water level increases in ten steps from the lowest point in the terrain to the highest.

public static void floodMap (double[][] heights, double waterLevel)

Step by Step Solution

3.38 Rating (160 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres one way to implement the method in Python def floodmapterrain The tas... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java Concepts Late Objects Questions!