Question
All the sub-problems given below must be designed using functions. At least three functions related to getting input from user, implementing the main logic of
All the sub-problems given below must be designed using functions. At least three functions related to
getting input from user, implementing the main logic of the program, and printing the output must be
present. Other than that, you may use any additional functions that you may deem appropriate for your
program. Your programs should be able to run as many times as the user wants.
Problem 1:
Re-do Problem 1 of Assignment 5 using the 2D array integer array of size 4 x 6 given below:
24, -78, 9, 14, 11, -89
13, -8, 23, 62, -25, 43
-15, 42, 18, 81, 45, 7
17, -18, 56, 83, 16, 5
Write a C++ program to find the pair of elements that has the maximum and minimum absolute difference
among all element pairs (either row-wise or column-wise).
Your output should print:
-- The element pair along with their 2D index ([row][column] value; you dont have to add 1 to the
indexes when you print their value)
-- Whether they are a row-wise pair or a column-wise pair
-- Their difference value
Note: example of a row-wise pair: (11,-89); example of a column-wise pair: 42,-18
problem 1 from assignment 5. Consider the integer array of size 10 below given as input by the user: 5,9,3,6,12,56,67,29,31,38 Write a C++ program to find the pair of elements that has the maximum and minimum absolute difference among all element pairs. Note: absolute value can be computed by including the header cmath and using the in-built function call to abs(number). Therefore, if number is a variable that stores the value -10, abs(number) will return 10. (3 points)
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