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

Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter5: The Repetition Structure
Section: Chapter Questions
Problem 1MQ6: Write an Add method that adds the contents of the decPrice variable to the lstPrices control.
icon
Related questions
Question

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
main.c
+ c
Test Cases
Output
1
Note that the row number starts at 0,
not 1.
CE Run Tests
Enter # of rows: 3
Enter # of columns: 3
Test Case
Enter elements:
1
2.7 4
1.1 2
0.5-0
Test Case
Even row: 1
Test Case
3
Score: 0/10
>
Transcribed Image Text:main.c + c Test Cases Output 1 Note that the row number starts at 0, not 1. CE Run Tests Enter # of rows: 3 Enter # of columns: 3 Test Case Enter elements: 1 2.7 4 1.1 2 0.5-0 Test Case Even row: 1 Test Case 3 Score: 0/10 >
Expert Solution
steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Knowledge Booster
Data Modeling Concepts
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 with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning