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;
}
}
The answer would be slide
The following are the steps involved in the Process validation to the industry standard,
1) Design of the process
2) Qualification of the process
3) Verification of the process
Explanation:
Validation is the process of finding whether the process meets its expected outcome.
1) Construct knowledge about the process to be performed and establish a final design.
2) Evaluation of the designed process is being done at this stage to rectify the errors and changes can be done.
Test the process to check whether the expected goal of the process being designed is achieved or not.
Answer: A top level class without any modifier is accessible to any class within the same package.
Explanation: A top level class is class whose declaration occur in the body of their own class therefore it is not a nested class.It cannot be declared in any other class.Private modifier is not allowed in the top level class because there would be no access in the class. Therefore top level class which does not have any modifier can be accessed by any class within the same package .