Question: Need simple C++ code to count the number of blobs in a 9x9 grid. See what constitutes a blob in the screen shot of question

 Need simple C++ code to count the number of blobs in

Need simple C++ code to count the number of blobs in a 9x9 grid. See what constitutes a blob in the screen shot of question 1. To clarify, Question 2 "Counting Blobs" is the problem I need code for, though I would appreciate help with #1 as well.a 9x9 grid. See what constitutes a blob in the screen shot

2. Counting Blobs (15 pts) Consider the same grid specification from the problem above, the goal of your program is to count the total number of blobs. Input The input for this program is provided as command line arguments, as shown below File name for the grid of cells KM> Number of rows in the grid KN> Number of colunns in the grid KCONN> Connection type. Can be either 4or8 The rows are numbered 1 through M from top to bottom, and the columns are numbered 1 through N from left to right, 2 M,N 16. The line below shows an example of using your program: s./blobs grid.txt 8 8 4 Output Your program should write to the standard output, the count of blobs in the grid. For example, considering the input file below: 8111e e 8111e e 1118ee e 1118ee e 118111e e 1 1e1 1 1 e e Your program should output the following values: s./blobs grid.txt 8 8 4 s./blobs grid.txt 8 8 8 2. Counting Blobs (15 pts) Consider the same grid specification from the problem above, the goal of your program is to count the total number of blobs. Input The input for this program is provided as command line arguments, as shown below File name for the grid of cells KM> Number of rows in the grid KN> Number of colunns in the grid KCONN> Connection type. Can be either 4or8 The rows are numbered 1 through M from top to bottom, and the columns are numbered 1 through N from left to right, 2 M,N 16. The line below shows an example of using your program: s./blobs grid.txt 8 8 4 Output Your program should write to the standard output, the count of blobs in the grid. For example, considering the input file below: 8111e e 8111e e 1118ee e 1118ee e 118111e e 1 1e1 1 1 e e Your program should output the following values: s./blobs grid.txt 8 8 4 s./blobs grid.txt 8 8 8

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!