Posted by : Unknown Jumat, 31 Agustus 2012

/*
 * 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;
    }
}


Leave a Reply

Subscribe to Posts | Subscribe to Comments

Welcome to My Blog

Apakah Blog Ini Menarik?

Popular Post

Blogger templates

- Copyright © InsideMyBlogger -Saint Tecnology- Powered by Blogger - Designed by Wildan Ery Arstama -