Wednesday, April 3, 2013

contoh "IF"


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

package tugas;
/**
 *
 * @author surur
 */
public class logicalIF {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        int nilai=33;
        if(nilai>=76)
            System.out.println("A");
        else if (nilai >= 66)
                System.out.println("B");
        else if (nilai>=56)
            System.out.println("C");
        else if (nilai>=46)
            System.out.println("D");
        else
            System.out.println("E");


    }

}

No comments:

Post a Comment