Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

*/ // write the required preprocessor directives // declare an integer constant named COLUMNS and initialize to 4 // The following methods receive a two-dimension

*/ // write the required preprocessor directives // declare an integer constant named COLUMNS and initialize to 4 // The following methods receive a two-dimension integer // array and the size of the first dimension as parameters void fillTwoDim(???); int addTwoDim(???); float average(???); void printTwoDim(???); void personalInfo(); // This method has no parameters or return value int main(){ // declare an integer constant named ROWS and initialize to 5 // declare a two-dimension integer array named numbers using the // constants as the size and initialize all elements to 0 // call the printTwoDim method // call the fillTwoDim method to populate the array // call the printTwoDim method // print the phrase "The average of all values in the array is [average]." // Call the appropriate function to obtain the average value. // call the personalInfo method system("pause"); // For Visual Studio only! return 0; } // The fillTwoDim method receives a two-dimension integer array and the size of the // first dimension as parameters and has no return value. If uses the pseudo random // number generator function to assign a value between 0 and 500 to every element of // the array. Make sure to seed the pseudo random number generator before calling the // rand function. The only variables declared in this method are the counters used in // the for iteration control structures. // The addTwoDim method receives a two-dimension integer array and the size of the // first dimension as parameters and returns an integer value. Declare the local integer // variable suma and initialize it to 0. The method implements a nested for iteration // control structure to add all values in the array and returns the sum. // The average method receives a two-dimension integer array and the size of the // first dimension as parameters and returns a float value. Call the addTwoDim method // to obtain the sum and return the average value. // NO VARIABLES ARE DECLARED IN THIS METHOD // The printTwoDim method receives a two-dimension integer array and the size of the // first dimension as parameters and has no return value. It prints the contents of // the array in a matrix format where a tab space is inserted before each value. // First, print the phrase "The values stored in the two-dimension array are:" // Then print the contents of the array using the tab space as described above. // Make sure to add a blank line after all values are printed. // The personalInfo method prints a statement with your personal information using // the phrase "***** Program developed by [YOUR NAME], ID# [YOUR ID NUMBER] *****" // where the square brackets and the text within is substituted with your personal // information. Make sure to add a blank line after the phrase is printed.

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

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions

Question

What media access control technique does your class use?

Answered: 1 week ago