Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How would I create this sample output without the loadDiagonal and print1Darray functions? I have the first few functions created int findZeros(int arraylIIMAXI, int size):

How would I create this sample output without the loadDiagonal and print1Darray functions? I have the first few functions created
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
int findZeros(int arraylIIMAXI, int size): Count the number of zero's in your 2-D array, return the count to the main). int findEvenOdd(int IlMAXI, int): This function takes in the 2D array and size as the parameters and counts the number of evenfor odd) numbers in the array and returns the value. Based on the value returned back to main0. find the other value and print both even count and odd count in main void loadDiagonal(int [MAXI, int, int MAXD: This function takes the 2D array, size and the ID array created in main0 to store the diagonal elements. Load the primary diagonal elements from the 2D array into this array void printIDArray(int all, int): Used to print the 1D array. Use for printing the contents of the diagonal array. This is called after calling the loadDiagonal function. Same as last weeks function. void printTranspose(int MAX], int): Takes the 2D Array and the size as the parameter and prints the contents of the array in a transposed manner, i.e prints the rows as columns and columns as rows. int main(void): Like the prelab, first read the size of the 2D array in the main if the size is 20 display an error message and ask for a new input from, the user. Using this size to initialize the 2D array with the random numbers. Print the array content as shown in the sample output below. Use findZeros to display the number of zero's as shown in the sample output below. Use findEvenOdd to display the number of even and odd numbers in the 2D array. Call the loadDiagonal function by sending the 2D array, size and a 1D array initialized in main0. inside the function load the contents of the ID array with the primary diagonal elements from the 2D array. Then call printiDArray function on the diagonal array you created to print its contents. PrintlDArray is the exact same as the print array function from last week's lab. Next, call the printTranspose function on the 2D array to print the rows and columns in a transposed fashion. Sample Output Characters in bold are input from the user Enter the size of the 2-D array:-1 Please enter a value between 1-20 only: 21 Please enter a value between 1-20 only:6 THE FIRST 2-D ARRAY is: 555011 779219 723672 894703 494074 641162

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

Recommended Textbook for

Seven Databases In Seven Weeks A Guide To Modern Databases And The NoSQL Movement

Authors: Luc Perkins, Eric Redmond, Jim Wilson

2nd Edition

1680502530, 978-1680502534

More Books

Students also viewed these Databases questions

Question

List the different categories of international employees. page 689

Answered: 1 week ago