Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The only things I need help with are in bold. I need a function howManyEven that would find the total number of even elements in

The only things I need help with are in bold. I need a function howManyEven that would find the total number of even elements in an array. And I need a function printArray, that prints the elements in the array with proper formatting. When writing these 2 functions please try to code these 2 functions so they will fit in the program easily. Thank you very much!

image text in transcribed

Program 1 Given that arrayIntValues [MAX_ROWS][MAX_COLUMNS) is a 2 dimensional array of positive integers, write a C++ function howManyEven to find the total number of even elements in the array. It should have input parameter array arrayIntValues. The function should return an integer. Also create a C++ function called printArray, with the input parameter array arrayIntValues, to print out the elements in the array (be sure to have row and column labels and proper formatting (i.e.s|column values line up). Main must be in one source file and all other functions in a second source file. The constants MAX_ROWS and MAX_COLUMNS must be accessed globally by defining the following global variables: or const int MAX_ROWS = 3; const int MAX COLUMNS = 2; #define MAX_ROWS 3 #define MAX_COLUMNS 2 or The array arrayIntValues is initialized by the following statement within main(): int arrayIntValues [MAX_ROWS][MAX_COLUMNS] = {{3, 2}, {4,5}, {2, 2} }; Print out the array and the count of positive even numbers (label appropriately) in function printArray. User enters a new set of values into the array (must do it at least once) as many times as they wish and runs printArray against the new array values each time. Be sure to validate input is positive integers. Validate user input ("y" or "n") when asking if the user wants to enter a new set of values

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database Foundations Technology Fundamentals For IT Success

Authors: Bob Bryla

1st Edition

0782143725, 9780782143720

More Books

Students also viewed these Databases questions

Question

Question What is a Roth 403 (b) plan?

Answered: 1 week ago