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;
}
}
A Petri dish (Petri plate) is a shallow cylindrical glass lidded dish that is typically used to culture microorganisms (agar plates). There are glass and plastic Petri dishes, and both can be sterilized (using an autoclave) and re-used. Before being used for culture purposes, it is important to ensure that the Petri dish is not only clean, but also sterile. This helps prevent the contamination of the new culture.Agar is a polymer made up of various sub-units of galactose and various species of red algae. Although it has other uses including culinary and dentistry, agar plays an important role in microbiology as culture media for a variety of microorganisms.As compared to some of the other alternatives like gelatin, agar has a number of advantages which include:Cannot be easily degraded by microorganism Stronger Firmer than gelatin
After you use the create sequence statement to create a sequence, you can use the NEXTVAL pseudo column to get the next value in the sequence.
<h3 /><h3>How do you create a sequence?</h3>
- You must have the Create any sequence system privilege to create a sequence in another user's schema.
- Specify the schema that will hold the sequence.
- If you leave out schema, Oracle Database will create the sequence in your own schema. Name the sequence that will be created.
- Pseudo-columns allow selection, but you cannot edit, update, or remove their values.
- A pseudo-column is analogous to a function that does not accept any inputs. This section goes over the two pseudo-columns, CURRVAL and NEXTVAL.
- A pseudo column is a "column" that displays a value when a value is selected but is not one of the table's true columns.
- Two examples are SysDate and RowID. It is frequently used in tandem with the DUAL table.
- After you utilize the make sequence statement to make a sequence, you can utilize the NEXTVAL pseudo column to obtain the next value in the sequence.
To learn more about NEXTVAL, refer to:
brainly.com/question/13043887
#SPJ4