Answer to Question #249757 in C++ for Mgcina

Question #249757

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


1
Expert's answer
2021-10-12T00:36:53-0400
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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS