Question: C code program (NOT C++) Txt file: pressure.txt (overview of file) Problem 2: A resistive film touch screen determine the finger location be detecting changes

C code program (NOT C++)

Txt file: pressure.txt

(overview of file)

C code program (NOT C++) Txt file: pressure.txt (overview of file) Problem

Problem 2: A resistive film touch screen determine the finger location be 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 subgrid that surround it.

Develop a program that reads the pressure values of the 10x10 grid from a file called pressure.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 *x_p, int *y_p)

The screen array represents the pressure values. The x_p and y_p pointers are used to return the coordinates of the finger location

2: A resistive film touch screen determine the finger location be detecting

pressure.txt 1 1 1 1 1 1 1 Sample file with pressure values 0 1 1 2 3 2 1 2 1 0 0 1 1 5 2 1 2 1 20 0 1 1 1 2 1 2 1 20 Cell with the highest pressure, when averaged over the surrounding 3x3 grid 0 2 1 1 2 444 1 0 0 1 1 21 3 4 3 1 0 0 2 1 1 2 2 2 1 1 0 The finger location is at (6,7) coordinate

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!