Senin, 24 Oktober 2011

flowchart dan netbeans bilangan prima


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package riezal;

import java.util.Scanner;

/**
 *
 * @author TOSHIBA
 */
public class Bilangan_prima {
    public static void main(String[] args) {

       int n;
        System.out.println("\n Masukkan Angka yang akan diuji = ");
        Scanner input = new Scanner (System.in) ;
        n = input.nextInt();

        boolean isPrime = false;
    if (n >= 2) {
        isPrime = true;
       for (int z = 2; z < n; z++) {
        if (n % z== 0) {

                isPrime = false;

            }
        }
    }
    System.out.println("the answer is " + isPrime);
}
}




Minggu, 23 Oktober 2011

flowchart mencari channel TV

flowchart & netbeans persegi panjang






package persegi_panjang;

/**
 *
 * @author TOSHIBA
 */
public class Main {

    /**
     * @param args the command line arguments
     */

 public static void main(String[] args) {
        double p,l,L;

        p = 20;
        l = 15;

        L = p*l;

        System.out.println("Luas persegi panjang" +L);// TODO code application logic here
    }

}


flowchart memperbaiki sepeda motor

flowchart menggoreng telur

tugaz algoritma nilai






package hasil_angka;

/**
 *
 * @author M SAIFUL RIZAL F
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
         double nilai;

        nilai = 71;

        if (nilai >= 0 && nilai <=40) {
            System.out.println("E");
        }
        else if (nilai >= 41 && nilai <=50) {
            System.out.println("D");
        }
        else if (nilai >= 51 && nilai <=60) {
            System.out.println("C");
        }
        else if (nilai >= 61 && nilai <=70) {
            System.out.println("B");
        }
        else if (nilai >= 71 && nilai <=80) {
            System.out.println("A");
        }
        else if (nilai >= 81 && nilai <=100) {
            System.out.println("input salah");
        }{

        }
{

        }
// TODO code application logic here
    }

}