I can surely help with the very first question you have asked for. First you should have to see the approach. The task is to create a program that reads in 16 values from the keyboard and stores them into a two-dimensional array called myArray.
Then, the program should calculate the sum of elements for each row and each column and store these sums into separate arrays, rowSum, and colSum respectively. Here is the code snippet for you.
import java. util.Scanner;
public class ArraySum {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int[][] myArray = new int[4][4];
int[] rowSum = new int[4];
int[] colSum = new int[4];
// Input values
System.out.println("Enter 16 values:");
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
myArray[i][j] = scanner.nextInt();
rowSum[i] += myArray[i][j];
colSum[j] += myArray[i][j];
}
}
// Output arrays
System.out.println("Row sums:");
for (int i = 0; i < 4; i++) {
System.out.print(rowSum[i] + " ");
}
System.out.println("\nColumn sums:");
for (int i = 0; i < 4; i++) {
System.out.print(colSum[i] + " ");
}
}
}
Yes, there are many highly skilled and intelligent individuals in the field of Java programming. There exists a diverse community of professionals ranging from seasoned developers to academic experts who specialize in Java. You should also visit
https://www.programminghomeworkhelp....va-assignment/ for smooth academic journey.