Selasa, 03 Maret 2015

Keamanan Jaringan

Nama : Retno Anggrasari Purnomo
NIM : 130403010008
Tugas Keamanan Jaringan bisa di download di Sini

Kamis, 25 Desember 2014

Program java netbeans function

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

package function;

import java.util.Scanner;

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

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner masukkan = new Scanner(System.in);
        int bil1,bil2,bil3,jumlah;
        System.out.println("program menjumlahkan 2 bilangan");
        System.out.print("masukkan bilangan 1:");bil1 = masukkan.nextInt();
        System.out.print("masukkan bilangan 2:");bil2 = masukkan.nextInt();
        System.out.print("masukkan bilangan 3:");bil3 = masukkan.nextInt();
         System.out.println();
        System.out.println("jumlah bilangan 1+bil2:"+(jumlah(bil1,bil2)));
        System.out.println("jumlah bilangan 2+bil3:"+(jumlah(bil2,bil3)));
        System.out.println("jumlah bilangan 1+bil3:"+(jumlah (bil1,bil3)));
    }

    private static int  jumlah(int a, int b) {
        int hasil = a + b;
        return hasil;

    }

}

Java netbeans array

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

package arraymultidimensi;

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

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        int [] [] duaD = new int [2][3];
        int k =1;
        for(int i=0;i<2;i++){
            for(int j =0;j<3;j++){
                duaD [i][j]=k*10;
                System.out.print(duaD[i][j]);
                if(j<2)System.out.print(" ");
                k++;

            }
            System.out.println();
        }

    }

}

Program java netbeans inputan suhu

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

package inputan_suhu;

/**
 *
 * @author RETNO
 */
public class Main {
 
    public float celcius;
    private float hasilR, hasilK, hasilF;
    public float K;
    public float R;
    public float F;

 
    public void hasil(){
        this.R = (float)(this.celcius * 0.8);
        this.K = (float)(this.celcius + 273.15);
        this.F = (float)(this.celcius * 1.8 + 32);
    }


    public void tampilkanHasilR(){
        System.out.println("hasil Reamur adalah:"+this.R);
    }
    public void tampilkanHasilK(){
        System.out.println("hasil Kelvin adalah:"+this.K);
    }
    public void tampilkanHasilF(){
        System.out.println("hasil Fahrenhait adalah:"+this.F);
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
         Main op1 = new Main();
        op1.celcius=30;
        op1.hasil();
        op1.tampilkanHasilR();
        op1.tampilkanHasilK();
        op1.tampilkanHasilF();
        op1.celcius=45;
        op1.hasil();
        op1.tampilkanHasilR();
        op1.tampilkanHasilK();
        op1.tampilkanHasilF();

    }

}


     






Contoh program java class manusia

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

package class_manusia;

/**
 *
 * @author User
 */
public class Main {
    static String nama ="Retno Anggrasari Purnomo";
    static String rambut ="Hitam";
    static String tinggi = "155";
    static String berat = "45";
    static String umur = "19";
    static String mata = "bulat,hitam";
    static String hidung = "mancung";
 

public static void biodata()
{
System.out.println("Nama Lengkap : ");
System.out.println("Warna Rambut : ");
System.out.println("Tinggi Badan : ");
System.out.println("Berat Badan :");
System.out.println("Umur : ");
System.out.println("mata : ");
System.out.println("hidung : ");

}

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        System.out.println("Nama Lengkap : "+nama);
System.out.println("Warna Rambut : "+rambut);
System.out.println("Tinggi Badan : "+tinggi);
System.out.println("Berat Badan : "+berat);
System.out.println("Umur : "+umur);
System.out.println("mata : "+mata);
System.out.println("hidung : "+hidung);

    }

}