/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package thr;
/**
*
* @author 7 ultimate
*/
public class THR2 {
public int bulat(double bil[]) //fungsi penyeleksi untuk bilangan bulat
//variabel bil[] untuk menyimpan data dari parameter bilangan
{
int ayo;
int hasil = 0;
for(int i = 0;i < bil.length;i++)
{
if(bil[i] % 1 == 0) hasil = hasil + 1;//proses penyeleksian bilangan bulat
}
return hasil; //mengembalikkan nilai variabel hasil ke pemanggil fungsi
}
public int pecahan(double bil[])//fungsi penyeleksi untuk bilangan pecahan
{
int hasil = 0;
for(int i = 0;i < bil.length;i++)
{
if(bil[i] % 1 != 0) hasil = hasil + 1;//proses seleksi bil.pecahan
}
return hasil;
}
}