Monday, April 16, 2012

ARRAY TABEL


#include <iostream.h>
#include <conio.h>


void main()
{
int I[3][4];
int tahun,jurusan;
char jur[3][20]={"T.Industri","T.Planologi","T.Informatika"};


clrscr;
I[0][0] = 53;
I[0][1] = 70;
I[0][2] = 65;
I[0][3] = 60;
I[1][0] = 10;
I[1][1] = 13;
I[1][2] = 21;
I[1][3] = 15;
I[2][0] = 86;
I[2][1] = 132;
I[2][2] = 242;
I[2][3] = 195;
while(1)
{
cout<<"Jurusan(0=T.Industri,1=T.Planologi,2=T.Informatika)";
cout<<"\nMasukan jurusan =";
cin>>jurusan;


if((jurusan==0)||(jurusan==1)||(jurusan==2))
break;
}
while(1)
{
cout<<"Tahun(2001-2004) = ";
cin>>tahun;


if ((tahun>=2001)&&(tahun<=2004))
{
tahun-=2001;
break;
}
}
cout<<"\nJumlah Mahasiswa yang masuk = "<<I[jurusan][tahun]<<endl<<endl;
cout<<"\t\t2001\t2002\t2003\t2004\n";
cout<<"--------------------------------------------------\n";


for(int i=0;i<3;i++)
{
cout<<jur[i]<<"\t";
for(int j=0;j<=3;j++)
{
cout<<I[i][j]<<"\t";
}
cout<<endl<<endl;
}




}

No comments:

Post a Comment