... Engineering P6.15 You are given a two-dimensional array of values that give the height of a terrain at different points in a square. Write a function void flood_map(double heights [10] [10], double water level) 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. Here is a sample map: nicolamargaret Stockphoto. 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.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Using C++.

 

... Engineering P6.15 You are given a two-dimensional array of values that give the height of a terrain at different points in a square. Write a function
void flood_map(double heights [10] [10], double water_level)
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.
Here is a sample map:
Ⓒnicolamargaret/iStockphoto.
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.
Transcribed Image Text:... Engineering P6.15 You are given a two-dimensional array of values that give the height of a terrain at different points in a square. Write a function void flood_map(double heights [10] [10], double water_level) 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. Here is a sample map: Ⓒnicolamargaret/iStockphoto. 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.
Description
This lab assignment is loosely based on the End-of-Chapter Exercises Engineering P6.15. (In my
book that is on page EX6-3 which is the page before page 223). Review the instructions there
for some helpful information though there are differences expected for this lab project. Your
program should allow the user to enter a flood level, provide the appropriate map, and also
provide the lowest, highest, and average water levels. The average water level should be to
three decimal places, to the thousandth, not the tenth. The water level is, for
submerged/flooded points on the map only, the depth of the water at that point. That is, the
flood level minus the terrain height. Note that a point is only submerged/flooded if the flood
level is greater than the terrain height.
Write a program that will
a) Greet the user by name. Provide the user with a brief description of the program.
b) Invite the user to try the program. Allow user to choose.
c) Ask the user for the flood-level.
d) Based on the given input, provide a map.
a. In your map, indicate the area that is NOT flooded, the area at the flood level,
and the area that is flooded. Decide on meaningful symbols to use.
b. Provide the lowest water level and the location(s).
c. Provide the highest water level and the location(s).
d. Provide the average water level
e) Include some data validation (input checks) in case your user makes a mistake typing
or misunderstands the prompt.
f) Allow the user to repeat or quit.
g) End your program appropriately and in a friendly way.
Transcribed Image Text:Description This lab assignment is loosely based on the End-of-Chapter Exercises Engineering P6.15. (In my book that is on page EX6-3 which is the page before page 223). Review the instructions there for some helpful information though there are differences expected for this lab project. Your program should allow the user to enter a flood level, provide the appropriate map, and also provide the lowest, highest, and average water levels. The average water level should be to three decimal places, to the thousandth, not the tenth. The water level is, for submerged/flooded points on the map only, the depth of the water at that point. That is, the flood level minus the terrain height. Note that a point is only submerged/flooded if the flood level is greater than the terrain height. Write a program that will a) Greet the user by name. Provide the user with a brief description of the program. b) Invite the user to try the program. Allow user to choose. c) Ask the user for the flood-level. d) Based on the given input, provide a map. a. In your map, indicate the area that is NOT flooded, the area at the flood level, and the area that is flooded. Decide on meaningful symbols to use. b. Provide the lowest water level and the location(s). c. Provide the highest water level and the location(s). d. Provide the average water level e) Include some data validation (input checks) in case your user makes a mistake typing or misunderstands the prompt. f) Allow the user to repeat or quit. g) End your program appropriately and in a friendly way.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Arrays
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.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education