You are on page 1of 2

import java.io.

*;

public class Sales

public static void main(String args[])throws IOException

int z1[]=new int[10];

int z2[]=new int[10];

int z3[]=new int[10];

int z4[]=new int[10];

int z,i,j;

int s=0,p=0,r=0,t=0;

BufferedReader in=new BufferedReader(new InputStreamReader(System.in));

for(j=0;j<4;j++)

System.out.println("Enter the zone code:");

z=Integer.parseInt(in.readLine());

if(z==1)

for(i=0;i<10;i++)

z1[i]=Integer.parseInt(in.readLine());

s=s+z1[i];

if(z==2)

for(i=0;i<10;i++)

z2[i]=Integer.parseInt(in.readLine());
p=p+z2[i];

if(z==3)

for(i=0;i<10;i++)

z3[i]=Integer.parseInt(in.readLine());

r=r+z3[i];

if(z==4)

for(i=0;i<10;i++)

z4[i]=Integer.parseInt(in.readLine());

t=t+z4[i];

System.out.println("ZONE CODE\tTOTAL SALES IN THE ZONE");

System.out.println("1\t\t"+s);

System.out.println("2\t\t"+p);

System.out.println("3\t\t"+r);

System.out.println("4\t\t"+t);

You might also like