2. Dimensionary Investigation by Jay Vince Serato Iam Detective Jake Peralta. I am here to investigate a series of suspicious activities in the area. I have received a tip that someone is going to get mugged in my district. It seems that the victim is the most wealthy among the populace. Given an area represented by a 2-Dimensional Array, sum up the four numbers that are directly around the biggest number in the 2-D Array -- the one at the top, left, right, and bottom. Assume that there will be only one such number in the array. Dont worry if the said number has no number above or below iR, or at its left or right; that just makes my job easier. Example in the following 2-0 Array 5716 2618 1547 5891 4451 I see that 9 is the largest number in the aray, and therefore I will be adding up the number above it (4), the number at its left (8), the number at its right (1), and the number below it (s). Input 1. Number of Rows 2. Number of Columns 3. Elements of the 2-0 Array Output Enter nunber of rows: 5 Enter nunber of coluns: 4 Elements: 5716 2618 1547 5891 445

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter6: Arrays
Section: Chapter Questions
Problem 17RQ
icon
Related questions
Question

Dimensionary Investigation

Code in C language

main.c
: > + c
Executions
2. Dimensionary Investigation
by Jay Vince Serato
E Run Tests
I am Detective Jake Peralta. I am here to investigate a series of suspicious
activities in the area. I have received a tip that someone is going to get mugged in
Test Cases
my district. It seems that the victim is the most wealthy among the populace.
Given an area represented by a 2-Dimensional Array, sum up the four numbers that
O Test Case 1
are directly around the biggest number in the 2-D Array -- the one at the top, left,
right, and bottom.
Your Output
Assume that there will be only one such number in the array. Don't worry if the said
No Output
number has no number above or below it, or at its left or right; that just makes my
job easier.
Expected Output
Example in the following 2-D Array:
Enter number of rows: 5
5716
Enter number of columns: 4
2618
Elements:
1547
5716
5891
2618
4451
1547
5 89 1
4 451
I see that 9 is the largest number in the array, and therefore I will be adding up the
number above it (4), the number at its left (8), the number at its right (1), and the
number below it (5).
Suspect sum = 18
Input
1. Number of Rows
O Test Case 2
2. Number of Columns
3. Elements of the 2-D Array
O Test Case 3
Output
O Test Case 4
Enter number of rows: 5
Enter number of columns: 4
Elements:
O Test Case 5 Hidden
5-7-1-6
26-18
1.5.47
O Test Case 6 Hidden
589 1
4.45 1
O Test Case 7 Hidden
Suspect Sum = 18
Transcribed Image Text:main.c : > + c Executions 2. Dimensionary Investigation by Jay Vince Serato E Run Tests I am Detective Jake Peralta. I am here to investigate a series of suspicious activities in the area. I have received a tip that someone is going to get mugged in Test Cases my district. It seems that the victim is the most wealthy among the populace. Given an area represented by a 2-Dimensional Array, sum up the four numbers that O Test Case 1 are directly around the biggest number in the 2-D Array -- the one at the top, left, right, and bottom. Your Output Assume that there will be only one such number in the array. Don't worry if the said No Output number has no number above or below it, or at its left or right; that just makes my job easier. Expected Output Example in the following 2-D Array: Enter number of rows: 5 5716 Enter number of columns: 4 2618 Elements: 1547 5716 5891 2618 4451 1547 5 89 1 4 451 I see that 9 is the largest number in the array, and therefore I will be adding up the number above it (4), the number at its left (8), the number at its right (1), and the number below it (5). Suspect sum = 18 Input 1. Number of Rows O Test Case 2 2. Number of Columns 3. Elements of the 2-D Array O Test Case 3 Output O Test Case 4 Enter number of rows: 5 Enter number of columns: 4 Elements: O Test Case 5 Hidden 5-7-1-6 26-18 1.5.47 O Test Case 6 Hidden 589 1 4.45 1 O Test Case 7 Hidden Suspect Sum = 18
Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage