package employeesalesreport;
public class EmployeeSalesReport {
public static void main(String[] args) {
int [][] arrData = new int[5][3];
int [] employee_sales = {3000,2000,3500,2500,5500,3500,1100,2000,4500,1700,2700,2500,5000,2900,5900};
int k =0;
for(int i=0; i<5; i++){
for(int j=0; j<3;j++){
arrData[i][j] = employee_sales[k++];
}
}
System.out.println("*******************************************************************");
System.out.println("\t\t\tEMPLOYEE SALES REPORT");
System.out.println("*******************************************************************");
System.out.println("EMPLOYEE\t\tSALES 1\t\tSALES 2\t\tSALES 3");
int [] employee = {101111, 101122, 101133,101144,101155};
int [] total = new int[5];
for(int i=0; i<5; i++){
int sum = 0;
System.out.printf("%d-->\t\t",employee[i] );
for(int j=0; j<3; j++){
System.out.printf("R %d\t\t",arrData[i][j]);
sum += arrData[i][j];
}
total[i] = sum;
System.out.println(" ");
}
System.out.println("*******************************************************************");
System.out.println("\t\t\tEMPLOYEE TOTAL SALES");
System.out.println("*******************************************************************");
for(int i=0; i<5; i++){
System.out.printf("%d-->\t\t R %d\n",employee[i],total[i]);
}
}
}
Comments
Leave a comment