Question
Given that value[NUM_ROW][NUM_COLUMN][NUM_DEPTH] is a three dimensional array of double type and the three constants are defined as follows: #define NUM_ROW 4 #define NUM_COLUMN 4
Given that value[NUM_ROW][NUM_COLUMN][NUM_DEPTH] is a three dimensional array of double type and the three constants are defined as follows:
#define NUM_ROW 4
#define NUM_COLUMN 4
#define NUM_DEPTH 3
double value[NUM_ROW][NUM_COLUMN][NUM_DEPTH] = { 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0, 4.1, 4.2, 4.1, 4.2, 4.3, 4.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2};
Write a C++ program that computes and prints out the following information about this 3d array:
(1) The minimum and maximum values among all the array elements (2 points).
(2) The average values of all the array elements (2 points).
(3) The location (i, j, k) of the element that has the maximum value difference with its neighboring elements. Here (i, j, k) refers to the array indices of the element.
If the current element is inside the element domain, the neighboring elements are 6 (top, down, left, right, front, and back). You have to create at least three different functions to accomplish the above three tasks. You are not allowed to use only the main routine to conduct the computation
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started