Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need simple C++ code to count number of blobs in a 9x9 grid. The first proble of counting cells in a blog is only for

Need simple C++ code to count number of blobs in a 9x9 grid. The first proble of counting cells in a blog is only for reference of the directions. image text in transcribed

image text in transcribed

1. Counting Cells (20 pts) Consider a grid of cells in two dimensions, where each cell is considered empty or fi1led. Any number of cells that are connected constitutes a blob. Every cel can either be connected to 4 adjacent cells (vertically, horizontally) or to 8 adjacent cells (vertically, horizontally, diagonally). The goal of your program is to count the number of cells in a blob, given a starting cell. Input The input for this program is provided as command line arguments, as shown below: fnane> File name for the grid of cells M> Number of rows in the grid N> Number of colunns in the grid Row of the starting cell Column of the starting cell CONN> Connection type. Can be either 4 or 8 The rows are numbered 1 through M from top to bottom, and the columns are numbered 1 through N from left to right. 2

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_2

Step: 3

blur-text-image_3

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

Visual Basic 4 Ole Database And Controls Superbible

Authors: Michael Hatmaker, C. Woody Butler, Ibrahim Malluf, Bill Potter

1st Edition

1571690077, 978-1571690074

More Books

Students also viewed these Databases questions