Compute the cyclomatic complexity of the following sample code: Sample Code 1 public class MineSweeper private int[][] myTruth; private boolean[][] myShow; public void cellPicked (int row, int col) {...


Compute the cyclomatic complexity of the following sample code:<br>Sample Code 1<br>public class MineSweeper<br>private int[][] myTruth;<br>private boolean[][] myShow;<br>public void cellPicked (int row, int col)<br>{<br>if( inBounds (row, col) && !myShow[row][col] )<br>{<br>myShow [row] [col] = true;<br>if( myTruth[row][col] == 0)<br>{<br>for (int r = -1; r <= 1; r++)<br>for (int c = -1; c <= 1; c++)<br>cellPicked (row + r, col + c);<br>}<br>}<br>public boolean inBounds (int row, int col)<br>{<br>return 0 <= row && row < myTruth.length && 0 <= col && col <<br>myTruth[0].length;<br>}<br>}<br>Run the above sample code on any tool to validate your answer.<br>

Extracted text: Compute the cyclomatic complexity of the following sample code: Sample Code 1 public class MineSweeper private int[][] myTruth; private boolean[][] myShow; public void cellPicked (int row, int col) { if( inBounds (row, col) && !myShow[row][col] ) { myShow [row] [col] = true; if( myTruth[row][col] == 0) { for (int r = -1; r <= 1;="" r++)="" for="" (int="" c="-1;" c=""><= 1;="" c++)="" cellpicked="" (row="" +="" r,="" col="" +="" c);="" }="" }="" public="" boolean="" inbounds="" (int="" row,="" int="" col)="" {="" return="" 0=""><= row="" &&="" row="">< mytruth.length="" &&="" 0=""><= col="" &&="" col="">< mytruth[0].length;="" }="" }="" run="" the="" above="" sample="" code="" on="" any="" tool="" to="" validate="" your="">

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here