Reference no: EM132196186
Write a C program that detects and reports on areas of brightness in the night sky...
You should preprocess your data to eliminate noise in following manner: for every negative value you encounter, average the (maximum of) 8 squares around it and replace the value with the average (rounded off to the nearest whole number; use nearbyint from math.h).
If one of the surrounding squares also is negative, use the value of 0 in computing the average.
Your input will consist of a single integer s representing the size of the grid followed by s Ã- s data values. Your output should be presented exactly like the sample run (using your name, of course, instead of mine).
You also must use functions to input your data into an array, to preprocess your array, and one to find and report the bright spots.
In other words you should have at least 3 separate functions defined that each are passed your two-dimensional data array where one function only inputs the array, one function only preprocesses the data to eliminate noise, and one function only finds and reports the bright spots.
These functions must all be called from main. You must define your array local to your main function and pass it into all functions that need it. You may not declare and use any global data (other than possibly preprocessor definitions to define the maximum size of the sky and debugging flags if used).