3) A function called isMagic is written below, your task is to write two of the helper functions ckRows and ckSDiagonal. ckRows checks the horizontal rows and ckSDiagonal checks the diagonal going...


3) A function called isMagic is written below, your task is to write two of the helper functions ckRows and<br>ckSDiagonal. ckRows checks the horizontal rows and ckSDiagonal checks the diagonal going from lower left to<br>upper right. Each function returns true when all the individual sums of rows or the diagonal are equal to the magic<br>number and false otherwise. An example magic square is shown, the size may not always be 3.<br>2 94<br>// value will be set, but may not be 5<br>// value will be set, but may not be 5<br>const int ROWS = 5;<br>const int COLS = 5;<br>bool isMagic(int arr[][COLS], int magic) {<br>return ckRows (arr, magic) && ckcols(arr, magic) &8<br>|<br>75 3<br>ckMDiagonal (arr, magic) && cksDiagonal(arr, magic);<br>6 1<br>8<br>Your solution should be in this box:<br>

Extracted text: 3) A function called isMagic is written below, your task is to write two of the helper functions ckRows and ckSDiagonal. ckRows checks the horizontal rows and ckSDiagonal checks the diagonal going from lower left to upper right. Each function returns true when all the individual sums of rows or the diagonal are equal to the magic number and false otherwise. An example magic square is shown, the size may not always be 3. 2 94 // value will be set, but may not be 5 // value will be set, but may not be 5 const int ROWS = 5; const int COLS = 5; bool isMagic(int arr[][COLS], int magic) { return ckRows (arr, magic) && ckcols(arr, magic) &8 | 75 3 ckMDiagonal (arr, magic) && cksDiagonal(arr, magic); 6 1 8 Your solution should be in this box:

Jun 03, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here