You will write a program to read in a file and found out how many groupings (blobs) of characters there




You will write a program to read in a file and found out how many groupings (blobs) of characters there are in the file. The image below is a sample input file. Note that it contains 6 groupings of characters or blobs.

A character is part of a grouping or blob if it touches another character in the grouping on 1 of 8

positions around it. (immediately above, left, right, below and on each corner) Notice that one of the groupings or blobs is located inside of another.

You will open a file called blob.txt which will be provided to you. The file will contain exactly 20 records each of which is exactly 70 characters long. Your program can make the assumption that both the file name and size of the file (rows and columns) are exact. The characters will either be a space (blank ) or have an upper case X