In: Computer Science
1. If the 4-bit two's complement representations of integers J and K are 0100 and 1001, respectively, then the decimal representation of integer (J - K) (K subtracted from J) is
2. The "correctness" core quality of software refers to the fact that ...
3. Running class TwoDSum, whose code is:
public class TwoDSum {
public static void main(String[] args) {
int[][] table =
{-1,7,-3},{0,2,-4},{9,-6,5};
int sum = 0;
for (int i = 0; i < table.length;
i++)
if (i !=
table.length - i)
sum += table[i][i] + table[table.length - i-1][i];
System.out.println("Sum is " + sum);
}
}
will display on the user console ...
4. The code of class Det below:
public class Det {
public static void main(String[] args) {
int[][] a = new int[2][];
a[0] = new int[2];
a[1] = new int[2];
a[0][0] = 2;
a[0][1] = 1;
a[1][0] = 5;
a[1][1] = 3;
int det = a[0][0]*a[1][1] -
a[0][1]*a[1][0];
System.out.println("Determinant
is " + det);
}
}
will ...
5. Given the two code fragments A) an B), below, to compute the final value of a variable grandTotal, of type double and a 0 initial value:
A)
double delta = 0.1;
for (int i=0; i<10000; i++)
grandTotal += delta;
B)
double delta = 0.001;
for (int i=0; i<1000000; i++)
grandTotal += delta;
Then variable grandTotal is...
6. An interface...
Dear Student ,
As per the requirement submitted above , kindly find the below solution.
Question 3:
Answer :a.Sum is 14
Explanation :Below is the correct code and output on the console.

*******************************
Question 4:
Answer :a.display "Determinant is 1" on the user console.
Explanation :Line int det = a[0][0]*a[1][1] - a[0][1]*a[1][0]; will print 1 because 2*3-5*1=1.Below screen shows the output

*******************************
Question 5:
Answer :a.Both code fragments, A and B, compute grandTotal without any round-off error
Explanation :Below screen shows the output of both the code fragment
A.

B.

*******************************
Question 6:
Answer :a.Cannot be extended.
Explanation :An interface can only implemented can not be extended.
*******************************
NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.