7.2.1. Array merupakan struktur data yang menyimpan kumpulan nilai tipe data yang sama Cara pendeklarasian : Type_data nama_array=new Type_data[ukuran]; berikut contoh SourceCode : int Data[]=new int[100]; 7.2.2 Flowchart :
START ukuran; Data[ukuran];
for(int i =0;i
Max(x[],max)
Min(x[],max)
daMax=x[0];
daMin=x[0];
for(int i=0;i<max;i++)
for(int i=0;i<max;i++)
Data[i]=Integer.parseInt(xx.readLine()) ;
for(int i =0;i
“Data[i]”
x[i]>daMax
YA
TIDAK
daMax=x[i];
x[i]
TIDAK
daMax;
daMin;
STOP
STOP
Min(Data,ukuran);
Max(Data,ukuran);
STOP
Output :
YA
daMin=x[i];
Source Code : import java.io.*; class progammod7{ public static void main(String[] args)throws Exception { DataInputStream xx=new DataInputStream(System.in); System.out.print("Inputkan banyak bilangan = "); int ukuran=Integer.parseInt(xx.readLine()); int Data[]=new int[ukuran]; for(int i=0;i
} //cari data max public static void Max(int []x,int max) { int daMax=x[0]; for(int i=0;i<max;i++) { if (x[i]>daMax) { daMax=x[i]; } } System.out.println("Nilai minimal = "+daMax); } //cari data min public static void Min(int []x,int max) { int daMin=x[0]; for(int i=0;i<max;i++) { if (x[i]
System.out.println("\na= "+a); System.out.println("i= "+i); System.out.println("u= "+u); System.out.println("e= "+e); System.out.println("o= "+o); } }