Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need simple C++ code to count how many cells in a blob. See required output. 1. Counting Cells (20 pts) Consider a grid of cells

image text in transcribed

Need simple C++ code to count how many cells in a blob. See required output.

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 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

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

Database Concepts

Authors: David Kroenke, David J. Auer

3rd Edition

0131986252, 978-0131986251

Students also viewed these Databases questions

Question

=+ How is this likely to impact manpower requirements?

Answered: 1 week ago

Question

3. Existing organizations and programs constrain behavior.

Answered: 1 week ago