# Lab 7 - Lab Seven[30 points 5 points extra credit This lab...

This preview shows pages 1–3. Sign up to view the full content.

CIS 209 - 2d Arrays - Page 1 of 6 Lab Seven [30 points + 5 points extra credit] This lab has only one part, for which you must write one algorithm/program. Submit a zip file of the project folder as usual. Try to work through the lab on your own, but if you get stuck, ask a neighbor or the instructor for help. Just be sure that you understand everything that you turn in. Be sure to read the entire assignment before you begin. The Problem In this lab, the problem we want to study is, “What areas of Manhattan are likely to flood due to rainfall?” You must write a program that outputs the areas of Manhattan that would flood in response to rainfall over a given number of days. Consider the diagram on the right. Manhattan has been divided into a grid with 4 rows and 6 columns. Your program should read two inputs from the user: the random seed, and the number of days to simulate. Your program should step through each day of the simulation period, and on each day, it should print out a grid of numbers that shows the cumulative rainfall at each grid cell. At the end of the simulation period, it should draw the grid with an X in each cell where flooding occurs, and a . in each cell where flooding does not occur. Flooding occurs at a cell if the cumulative rainfall reaches 12 inches by the last day of the simulation period.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
CIS 209 - 2d Arrays - Page 2 of 6 Program Input & Output The output of your program should look similar to the following, although the random rainfall amounts will be different. Notice how the amount of rainfall at each grid cell in-
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 08/29/2011 for the course CIS 209 taught by Professor Aren during the Spring '11 term at Kansas State University.

### Page1 / 6

Lab 7 - Lab Seven[30 points 5 points extra credit This lab...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online