Ini dia Scriptnya
public static void main(String[] args) {
{
int[ ][ ] tabel = { {1245,1300,1432,1339},
{1878,1900,1987,1230},
{1500,1785,1980,2200},
{1987,1998,1026,1129},
{1400,1587,1765,1578}};
String [ ] bulan = {"Januari ", "Pebruari", "Maret ", "April "};
public static void main(String[] args) {
{
int[][] tabel = { {1245,1300,1432,1339},
{1878,1900,1987,1230},
{1500,1785,1980,2200},
{1987,1998,1026,1129},
{1400,1587,1765,1578}};
String [] bulan = {"Januari ", "Pebruari", "Maret ", "April "};
String [] merek = {"Honda ", "Minerva ", "Yamaha ", "Suzuki ", "Kawasaki"};
int barisT;
int kolomT;
int barisB;
int kolomM;
System.out.print (" ");
for(barisB=0; barisB<4; barisB++)
{
System.out.print (bulan[barisB] + " ");
}
System.out.println();
for(kolomM=0; kolomM<5; kolomM++)
{
System.out.print (merek[kolomM]);
for (barisT=0; barisT<4; barisT++)
{
System.out.print (" " + tabel[kolomM][barisT]);
}
System.out.println();
}}}}
{
int[ ][ ] tabel = { {1245,1300,1432,1339},
{1878,1900,1987,1230},
{1500,1785,1980,2200},
{1987,1998,1026,1129},
{1400,1587,1765,1578}};
String [ ] bulan = {"Januari ", "Pebruari", "Maret ", "April "};
public static void main(String[] args) {
{
int[][] tabel = { {1245,1300,1432,1339},
{1878,1900,1987,1230},
{1500,1785,1980,2200},
{1987,1998,1026,1129},
{1400,1587,1765,1578}};
String [] bulan = {"Januari ", "Pebruari", "Maret ", "April "};
String [] merek = {"Honda ", "Minerva ", "Yamaha ", "Suzuki ", "Kawasaki"};
int barisT;
int kolomT;
int barisB;
int kolomM;
System.out.print (" ");
for(barisB=0; barisB<4; barisB++)
{
System.out.print (bulan[barisB] + " ");
}
System.out.println();
for(kolomM=0; kolomM<5; kolomM++)
{
System.out.print (merek[kolomM]);
for (barisT=0; barisT<4; barisT++)
{
System.out.print (" " + tabel[kolomM][barisT]);
}
System.out.println();
}}}}
Dan hasil akhirnya seperti ini
0 komentar:
Post a Comment