write a java program to display a three-month delivery report for three different years , using two dimensional array
import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
int [][] delivery=new int [3][4];
for(int i=0;i<3;i++){
System.out.println("Enter details for year "+(i+1));
int n=1;
for(int j=0;j<4;j++){
System.out.println("Enter delivery report for "+(i+1)+" three months: ");
delivery [i][j]=in.nextInt();
}
}
for(int i=0;i<3;i++){
System.out.println("Delivery details for year "+(i+1));
for(int j=0;j<4;j++){
System.out.println(delivery[i][j]);
}
}
}
}
Comments
Leave a comment