Question #249757

write a java program to display a three-month delivery report for three different years , using two dimensional array


Expert's answer

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]);
		    }
		}
	}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS