import java.util.Scanner;
class satugrafik {
static String data [][]=new String [10][5];
static int y=0;
static void inputan(int tahun){
int n=9-tahun;
for (int x=0;x<10;x++){
if (x<=n){data[x][y]=" ";}
else data[x][y]="###";
}
y=y+1;}
static void tampil(){
int p=10;
for (int x=0;x<10;x++){
System.out.print(""+p+"| ");
for (int z=0;z<5;z++){
System.out.print(data[x][z]+" ");
}
System.out.println("");
p=p-1;
}
System.out.println(" 1995 1996 1997 1998 1999");
System.out.print(" Jumlah Penduduk Madura");
}
public static void main(String[]args){
Scanner in = new Scanner(System.in);
System.out.print("Data (dalam jutaan): "); System.out.println("");
System.out.print("Tahun 1995: ");
int t1995=in.nextInt();
inputan(t1995);
System.out.println("");
System.out.print("Tahun 1996: ");
int t1996=in.nextInt();
inputan(t1996);
System.out.println("");
System.out.print("Tahun 1997: ");
int t1997=in.nextInt();
inputan(t1997);
System.out.println("");
System.out.print("Tahun 1998: ");
int t1998=in.nextInt();
inputan(t1998);
System.out.println("");
System.out.print("Tahun 1999: ");
int t1999=in.nextInt();
inputan(t1999);
System.out.println("");
tampil();
}
}
Tidak ada komentar:
Posting Komentar