Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use pencil and paper, answer the following four question. Thanks. 1) Consider a 5-by-7 int array test. a. Write the declaration for test: b.

Please use pencil and paper, answer the following four question. Thanks.

image text in transcribed

image text in transcribed

1) Consider a 5-by-7 int array test. a. Write the declaration for test: b. How many rows does test have? c. How many columns does test have? d. How many elements does test have? e. Write statements that will display the elements in the first row of test (In doing this problem, first do it individually. Then share your answers with your partner and make any needed corrections.) 2) Suppose you need to write a function called range that will determine and return the absolute value of the difference between the largest and smallest values in an array consisting of NUM elements of type double. a. Write the declaration for function range. b. Ifdensity is an array of type double with NUM elements, write the statement that will call range and assign the result to the double variable densityRange. 3) Suppose you need to write a function called numZeros ) that will determine and return the number of zero elements in the test array described in warmup Problem (1). Assume that global const int varia bles ROWS and COLS have been previously declared and represent the number of rows and columns in test, respectively a. Write the declaration for function numZeros. b. Write the statement that will call numZeros from a main calling function and assign the number of zeros to an int variable zeros 4) Represent the following matrix using a two-dimensional array and write a nested for loop to initialize the elements (do not initialize the array in the declaration): 10 9 8

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

More Books

Students also viewed these Databases questions

Question

3. Describe the communicative power of group affiliations

Answered: 1 week ago