Jumat, 30 Desember 2011

program data mahasiswa

import java.util.Scanner;
class DataMahasiswa
{
public static void main(String args[])
{
String[][] data=new String[11][4];
for(int i=1; i<=10; i++)
{
System.out.println("Masukan data ke-" +i);
System.out.println("");

for(int j=1; j<=3; j++)
{
if (j==1)
{
System.out.print("Masukan No Mhs : ");
data[i][j]=new Scanner(System.in).next();
}
else if(j==2)
{
System.out.print("Masukan Nama : ");
data[i][j]=new Scanner(System.in).next();
}
else if(j==3)
{
System.out.print("Masukan jurusan : ");
data[i][j]=new Scanner(System.in).next();
System.out.println("");

}
}
}

for(int i=1; i<=10; i++)
{
for(int j=1; j<=3; j++)
{
System.out.print(data[i][j]+" ");
}
System.out.println("");
}
}
}

0 komentar:

Posting Komentar

Statistik

Translate

Blog Archive