Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Sim City Land Value Calculator Version 2: Find neighbours Let's find our neighbors! Neighbors are all the cells that are in the grid and are

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Sim City Land Value Calculator Version 2: Find neighbours Let's find our neighbors! Neighbors are all the cells that are in the grid and are horizontally, vertically or diagonally adjacent. Here is some visuals for what is a neighbor: Position (0,0) is highlighted in The neighbors are highlighted in red. The function returns a list of the blue red. neighbors' values: [6,1,4] Position (1, 1) is highlighted in The neighbors are highlighted in The function will return a list of the blue. red neighbors' prices: Position (2,1) is highlighted in The neighbors are highlighted in red. The function returns a list of the blue neighbors: [1,4,7,4,3] What to do Implement the find_neighbor_values() function that finds the neighbours given the coordinate location (row, col). You must use the following template: Hints - For the find_neighbor_values() function, consider three cases: The cell is at the edge of the grid. The cell is in the middle of the grid. The cell is at the corner of the grid. Example: Sim City Land Value Calculator Version 3: Estimate missing land values Some of the land values are missing! Let's estimate the missing value of a cell with value 0 , using the values of its neighbors. Once you have calculated the missing land values, display the updated grid. IMPORTANT: Do not modify the original grid, but create a new grid where no cell has missing values. Study the examples below to see how the f111gaps() function should work: Position (0,0) of our grid is We can get the average of the neighbor cell prices using the find_neigh function. [6,1,4] Position (2,1) of our grid is We can average the values from Position (2,1) of our new grid highlighted in blue. our find_neighbors function to becomes: fill the gap. [1,4,7,4,3] You can safely assume that if a cell value is missing (the value is given as 0 ), then none of the neighboring cell values are also missing. So you will always take averages over non-zero values. What to do Implement the fi11_gaps() function that estimates the missing land values within the grid and updates the grid. You must use the following template: Hints

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

Understanding Databases Concepts And Practice

Authors: Suzanne W Dietrich

1st Edition

1119827949, 9781119827948

More Books

Students also viewed these Databases questions