Question: Using C Program in Code blocks Given a 4x4 grid labeled 0-15 as shown below, write a function that accepts a goal (i.e., the goal

"Using C Program in Code blocks"

"Using C Program in Code blocks" Given a 4x4 grid labeled 0-15

Given a 4x4 grid labeled 0-15 as shown below, write a function that accepts a goal (i.e., the goal will be an input into the program) and computes the distance to goal of all the elements on the grid. Use ain array to store the distance to goal values. In the main (not in the function), display all the elements and their distance to the goal value. 15 14 13 12 Assume the side length of each square is 1. 11 10 9 8 Hint: use label%4 and label/4 to figure out rows and columns 4 3 2 1 0 EML 3811 Activity 3 Use the following function prototype void getDistancesToGoal(int goalLabel, float *distances); In the main: Ask the user for a goal label. Call your getDistancesToGoal function. - Print the goal label and all the distances to it. Call your find_max2 function from activity 1 and display the maximum distance - Note: for this problem you cannot use 2D arrays Given a 4x4 grid labeled 0-15 as shown below, write a function that accepts a goal (i.e., the goal will be an input into the program) and computes the distance to goal of all the elements on the grid. Use ain array to store the distance to goal values. In the main (not in the function), display all the elements and their distance to the goal value. 15 14 13 12 Assume the side length of each square is 1. 11 10 9 8 Hint: use label%4 and label/4 to figure out rows and columns 4 3 2 1 0 EML 3811 Activity 3 Use the following function prototype void getDistancesToGoal(int goalLabel, float *distances); In the main: Ask the user for a goal label. Call your getDistancesToGoal function. - Print the goal label and all the distances to it. Call your find_max2 function from activity 1 and display the maximum distance - Note: for this problem you cannot use 2D arrays

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!