This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

PERULANGAN adalah di gunakan untuk mengulang angka dengan yang kita ingin kan

Contoh program perulangan for :

 for(int a=1; a<=5; a++) {
           
            System.out.println(a);
        }
    }
    

}

maka output yang ditampilkan adalah
Add caption
disitu tertuliskan a=1 maka a akan mengulang sebanyak <5 artinya akan mengulang 1-5 dan a++ akan menambah 1 pada variable(increment)

0 komentar

FUNGSI IF DAN PERULANGAN

FUNGSI IF DAN PERULANGAN DALAM JAVA NET BEANS

Fungsi IF adalah suatu kondisi untuk menyeleksi beberapa pilihan yang tercantum dalam program
Contoh program if:

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
BufferedReader nilai = new BufferedReader(new InputStreamReader(System.in));
    try{
        System.out.println("Masukan nilai anda :");
        int n =Integer.parseInt(nilai.readLine());
        if (n>=81)System.out.println("Nilai anda A");
        else if(n>=71) System.out.println("Nilai anda B");
        else if(n>=51) System.out.println("Nilai anda C");
}catch(IOException e ){ 
System.out.println("error!");
        
    }
    }
 

0 komentar

Tugas JAVA NETBEANS

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;


    BufferedReader nilai = new BufferedReader(new InputStreamReader(System.in));
    try{
        System.out.println("Masukan nilai anda :");
        int n =Integer.parseInt(a.readLine());
        if (n>=81)System.out.println("Nilai anda A");
        else if(n>=71) System.out.println("Nilai anda B");
        else if(n>=51) System.out.println("Nilai anda C");
        else if(n>=41) System.out.println("Nilai anda D");
}catch(IOException e ){
System.out.println("error!");

}
    }
  
}

1 komentar