Question: Write in C pls Sample Output 0 0 0 0 0 0 0 0 0 0 0 1 3 2 1 2 1 1 1

Write in C pls

Write in C pls Sample Output 0 0 0 0 0 0

Sample Output 0 0 0 0 0 0 0 0 0 0 0 1 3 2 1 2 1 1 1 0 0 1 1 5 2 1 2 1 2 0 0 1 1 1 2 1 2 1 2 0 0 1 2 1 2 4 4 3 1 0 0 2 1 1 2 4 4 4 1 0 0 1 1 2 1 3 4 3 1 0 0 2 1 1 2 2 2 1 1 0 0 1 1 2 3 2 1 2 1 0 0 0 0 0 0 0 0 0 0 0 The finger location is at the coordinate (6,7).

A resistive film touch screen determines the finger location by detecting changes in the pressure applied to the film. Consider that the screen is represented by a 10x10 grid. Each grid cell individually records the pressure applied to the screen. The finger location is determined as the grid cell with the highest average value, where the average value is determined by the mean of the three-by-three sub-grid that surrounds it. Develop a program that reads the pressure values of the 10x10 grid from a file called pressure.txt (or pressure1.txt) into a two-dimensional array and then determines the grid location where the finger touches the screen. Ignore the border cells as candidate finger locations. Your code should use a function called fingerLoc to determine the coordinates of the finger. The fingerLoc function has the following prototype: void fingerLoc(int screen][10], int *xp, int typ); The screen array represents the pressure values. The xp and yp pointers are used to return the coordinates of the finger location. Sample file with pressure values (pressure.txt). 0000000000 0132121110 0115212120 0111212120 0121244310 0211244410 0112134310 0211222110 0112321210 0000000000 The finger location is at (6, 7) coordinate. Develop a program that: a) Reads a 10x10 two-dimensional array from the file pressure.txt (or pressure1.txt). Use the following function prototype for reading the array void readAr (FILE *in, int x[ ][10]); b) Computes the finger location c) Prints the 2 dim array plus finger location

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!