CODE USING C++ 2. First Even Road by CodeChum Admin I've been newly assigned as the city's road planner but this job seems tougher than I thought! Almost all of the roads in this city are uneven. To fix these, I need to find an even road as a reference. Fortunately, the mayor told me that there's 1 even road somewhere and if I persevere, I could find it. Could you please help me with this? Instructions: Your task is to ask the user for the number of rows and columns of a 2D array. Then, print the row number of the row where the sum of all of its elements is even. For this problem, it is guaranteed that there is one and only one such row. Input 1. Number of rows 2. Number of columns 3. Elements of the 2D array Output Note that the row number starts at 0, not 1. Enter·#·of·rows:·3 Enter·#·of·columns:·3 Enter·elements: 2·7·4 1·1·2 0·5·0 Even·row:·1

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 15RQ
icon
Related questions
Question

CODE USING C++

2. First Even Road

by CodeChum Admin

I've been newly assigned as the city's road planner but this job seems tougher than I thought!

 

Almost all of the roads in this city are uneven. To fix these, I need to find an even road as a reference. Fortunately, the mayor told me that there's 1 even road somewhere and if I persevere, I could find it.

 

Could you please help me with this?

 

Instructions:

  1. Your task is to ask the user for the number of rows and columns of a 2D array.
  2. Then, print the row number of the row where the sum of all of its elements is even.
  3. For this problem, it is guaranteed that there is one and only one such row.

Input

1. Number of rows

2. Number of columns

3. Elements of the 2D array

Output

Note that the row number starts at 0, not 1.

Enter·#·of·rows:·3
Enter·#·of·columns:·3
Enter·elements:
2·7·4
1·1·2
0·5·0
 
Even·row:·1
somewhere and if I persevere, I could find it.
Could you please help me with this?
Instructions:
1. Your task is to ask the user for the number of rows
and columns of a 2D array.
2. Then, print the row number of the row where the
sum of all of its elements is even.
3. For this problem, it is guaranteed that there is one
and only one such row.
Input
1. Number of rows
2. Number of columns
3. Elements of the 2D array
Output
Note that the row number starts at 0, not 1.
Enter # of rows: 3
Enter # of columns: 3
Enter elements:
2-7-4
1.1.2
0.5 0
Even row: 1
Transcribed Image Text:somewhere and if I persevere, I could find it. Could you please help me with this? Instructions: 1. Your task is to ask the user for the number of rows and columns of a 2D array. 2. Then, print the row number of the row where the sum of all of its elements is even. 3. For this problem, it is guaranteed that there is one and only one such row. Input 1. Number of rows 2. Number of columns 3. Elements of the 2D array Output Note that the row number starts at 0, not 1. Enter # of rows: 3 Enter # of columns: 3 Enter elements: 2-7-4 1.1.2 0.5 0 Even row: 1
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Function Arguments
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
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT