e problem areas based on the elevations in various regions and the expected rise of the nearby river after severe weather. Given a two-dimensional list/table representing a grid-layout map of elevations of different regions in the area, ask the user for a predicted elevation rise in the river water and show the problem areas by replacing the elevation for that area with an asterisk (*) to indicate that the area would be completely under water with the given river rise (e.g., if the region elevation is 200 or less and the river rise is 200 then that region would be completely submerged). You should not create a new list for this but replace the appropriate elevations in the original list with asterisks. Your code should use a method called printList to print the resulting representation of the map as shown in the sample output where the asterisks are printed as they occur but the unsubmerged elevations are replaced by the table coordinates (row,column) o

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 20PE
icon
Related questions
Question

Write the program in Python 

The town of Riverwood has been experiencing terrible flooding in the last few years and would like to have a visual representation of the problem areas based on the elevations in various regions and the expected rise of the nearby river after severe weather.

Given a two-dimensional list/table representing a grid-layout map of elevations of different regions in the area, ask the user for a predicted elevation rise in the river water and show the problem areas by replacing the elevation for that area with an asterisk (*) to indicate that the area would be completely under water with the given river rise (e.g., if the region elevation is 200 or less and the river rise is 200 then that region would be completely submerged). You should not create a new list for this but replace the appropriate elevations in the original list with asterisks. Your code should use a method called printList to print the resulting representation of the map as shown in the sample output where the asterisks are printed as they occur but the unsubmerged elevations are replaced by the table coordinates (row,column) of those elevations.

For example, if the given two-dimensional table is as follows:

elevations = [[243, 479, 549, 470, 331, 20], [492, 454, 231, 366, 65, 32], [71, 534, 285, 345, 509, 5], [204, 249, 145, 54, 211, 46], [124, 217, 545, 160, 242, 203], [461, 236, 436, 391, 508, 68], [428, 176, 85, 435, 496, 191],
[502, 238, 325, 144, 222, 95], [227, 504, 339, 132, 424, 298], [515, 202, 128, 54, 467, 307]]

Sample input/output for run 1:

Enter the expected river rise: 100

|0,0|0,1|0,2|0,3|0,4| * | |1,0|1,1|1,2|1,3| * | * | | * |2,1|2,2|2,3|2,4| * | |3,0|3,1|3,2| * |3,4| * | | 4,0 | 4,1 | 4,2 | 4,3 | 4,4 | 4,5 | |5,0|5,1|5,2|5,3|5,4| * | |6,0|6,1| * |6,3|6,4|6,5| |7,0|7,1|7,2|7,3|7,4| * | | 8,0 | 8,1 | 8,2 | 8,3 | 8,4 | 8,5 | |9,0|9,1|9,2| * |9,4|9,5|

Sample input/output for run 2:

Enter the expected river rise: 300

| * |0,1|0,2|0,3|0,4| * | |1,0|1,1| * |1,3| * | * | | * |2,1| * |2,3|2,4| * | |*|*|*|*|*|*| | * | * | 4,2 | * | * | * | |5,0| * |5,2|5,3|5,4| * | |6,0| * | * |6,3|6,4| * | | 7,0 | * | 7,2 | * | * | * | | * |8,1|8,2| * |8,4| * | |9,0| * | * | * |9,4|9,5|

Expert Solution
steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Knowledge Booster
Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning