Question: (a) (b) Declare two integer constants ROWSIZE equal to 4 and COLSIZE equal to 4. Declare two int two-dimensional arrays, namely play1 with ROWSIZE

(a) (b) Declare two integer constants ROWSIZE equal to 4 and COLSIZE 

(a) (b) Declare two integer constants ROWSIZE equal to 4 and COLSIZE equal to 4. Declare two int two-dimensional arrays, namely play1 with ROWSIZE number of rows and COLSIZE number of columns, and play2 with ROWSIZE number of rows and COLSIZE number of columns, (c) Assume that values have been assigned to all the elements of play1 and play2. Also assume that an int variable tricky has been declared and intialised to 0. Use nested for loops and write down the necessary C++ statements to do the following: Each row of play1 is compared element by element to the corresponding row of play2 If the elements are equal, add the value of one element to tricky. If the elements are not equal, add the sum of the two elements to the value of tricky. For example, if play1 and play2 are initialised as follows: 15 37 4 6 37 6 8 5 8 and 5 0 7 8 3 3 3 5 8 7 6 5 7 8 15 7 3 4 5 respectively, then the value of tricky will be: 5+11+3+7+11+8+12+8+11+10+9+5+7+11+5+5=128 Display the value of tricky.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

maincpp ANION MANDARDSEN28mam 1 include ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!