Answer:
public class MagicSquare {
public static void main(String[] args) {
int[][] square = {
{ 8, 11, 14, 1},
{13, 2, 7,12},
{ 3, 16, 9, 6},
{10, 5, 4, 15}
};
System.out.printf("The square %s a magic square. %n",
(isMagicSquare(square) ? "is" : "is not"));
}
public static boolean isMagicSquare(int[][] square) {
if(square.length != square[0].length) {
return false;
}
int sum = 0;
for(int i = 0; i < square[0].length; ++i) {
sum += square[0][i];
}
int d1 = 0, d2 = 0;
for(int i = 0; i < square.length; ++i) {
int row_sum = 0;
int col_sum = 0;
for(int j = 0; j < square[0].length; ++j) {
if(i == j) {
d1 += square[i][j];
}
if(j == square.length-i-1) {
d2 += square[i][j];
}
row_sum += square[i][j];
col_sum += square[j][i];
}
if(row_sum != sum || col_sum != sum) {
return false;
}
}
return d1 == sum && d2 == sum;
}
}
<span>Structured query Is The Answer.</span>
Answer:
a. Locate
Explanation:
Question options (obtained on the net):
a. Locate
b. Sort
c. Filter
d. Replace
Explanation:
The largest value of the weights of the dog breed in row 43 is the maximum weight of the dog breed in the row
The 'MAX' formula or the 'Autosum' tool can be used to give the largest value in a row, or column
To locate the maximum value in MS Excel, the ADDRESS and MATCH and MAX functions are combined and entered into the blank cell on the right, specifying the same range for the MAX and MATCH functions, and a '0' for the MATCH function as well as a '1' for the ADDRESS function as follows;
=ADDRESS(MATCH(MAX(A1:E1), A1:E1, 0), 1)
Therefore, to navigate to the maximum weight, Emily should use a <em>locate</em>(ing) tool navigate to the information on the spread sheet
Answer:
CSS is easy
Explanation:
CSS is like the color or your sylte for a webpage.
Answer:
sum, price, count
Explanation:
Programmers should use significant names for the variables.
Not only it makes it easier for them to remember what kind of information is stored in each variable, but it also makes life simpler for anyone who would read the code later.
Names like sum, price and count are significant names ( assuming they actually hold this kind of data), and will make the re-reading of the program code much easier.