casper. Powered by Blogger.

Blog ini bertujuan untuk share ilmu dan pengetahuan. Semua source/aplikasi di blog ini bebas disebar dan mencamtumkan sumber "fandy-alfa.blogspot.com".

RSS

ARRAY SORT

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

import java.io.IOException;

/**
 *
 * @author Fandy
 */

/*
 *  Nama : Fandy Adam
 *  Stambuk : E1E1 09 053
 *  Tugas Mata Kuliah : PBO
 *  Jurusan : IT
 *
 *  SOAL 6 : ARRAY SORT
 */

public class soal6 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {      
        int x [] = {29, 13, 10, 7, 34, 21, 4, 54, 30};
      
        System.out.println(" Aplikasi Sort Data ");
        System.out.println("====================");
        System.out.print("\nData sebelum dilakukan pengurutan : ");
        for (int i=0; i<x.length; i++) {
            System.out.print(x[i]+" ");
        }
       
        int temp;
        for (int i=0; i<x.length; i++) {
            for(int j=i; j<x.length; j++) {
                if(x[i] > x[j]) {
                    temp = x[i];
                    x[i] = x[j];
                    x[j] = temp;
                }
            }
        }
       
        System.out.print("\nData setelah dilakukan pengurutan : ");
        for (int i=0; i<x.length; i++) {
            System.out.print(x[i]+" ");
        }
    }
}
 
  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

PALINDRAME

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

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

/**
 *
 * @author Fandy
 */

/*
 *  Nama : Fandy Adam
 *  Stambuk : E1E1 09 053
 *  Tugas Mata Kuliah : PBO
 *  Jurusan : IT
 *
 *  SOAL 5 : PALINDRAME
 */

public class soal5 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {      
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
      
        System.out.println("Selamat Datang di Aplikasi Palindrame.");
        System.out.print("Silakan masukkan kata : ");
        String kata1 = input.readLine().trim();
       
        String kata2 = "";
        for(int i=kata1.length()-1; i>=0; i--) {
            kata2 = kata2 + kata1.charAt(i);
        }
       
        System.out.print("Kata \""+kata1+"\" adalah ");
        if(kata1.equalsIgnoreCase(kata2))
            System.out.println("palindrame");
        else
            System.out.println("bukan palindrame");
       
    }
}
 
  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

MAGIC TRIANGLE

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

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

/**
 *
 * @author Fandy
 */

/*
 *  Nama : Fandy Adam
 *  Stambuk : E1E1 09 053
 *  Tugas Mata Kuliah : PBO
 *  Jurusan : IT
 *
 *
 *  SOAL 4 : MAGIC TRIANGLE
 */

public class soal4 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {      
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
      
        System.out.println(" Aplikasi Magic Triangle ");
        System.out.println("=========================");
       
        System.out.print("Masukkan tinggi segitiga : ");
        int n=Integer.parseInt(input.readLine());
       
        for(int i=0; i<n; i++) {
            for(int j=n; j>=i; j--) {
                System.out.print(" ");
            }
           
            for(int j=0; j<=i; j++) {
                System.out.print("* ");
            }
            System.out.println();
        }
    }
}
 
  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

Deret Angka

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

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

/**
 *
 * @author Fandy
 */

/*
 *  Nama : Fandy Adam
 *  Stambuk : E1E1 09 053
 *  Tugas Mata Kuliah : PBO
 *  Jurusan : IT
 *
 *  SOAL 3 : DERET ANGKA
 */

public class soal3 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {      
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
      
        System.out.println(" Aplikasi Deret Angka ");
        System.out.println("======================");       
        System.out.print("Masukkan nilai N : ");
        int n = Integer.parseInt(input.readLine());
        System.out.print("Masukkan nilai interval: ");
        int interval = Integer.parseInt(input.readLine());
       
        for(int i=0; i<=n; i=i+interval) {
            System.out.print(i+"  ");
        }
    }
}
 
  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

Greeting

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

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

/**
 *
 * @author Fandy
 */

/*
 *  Nama : Fandy Adam
 *  Stambuk : E1E1 09 053
 *  Tugas Mata Kuliah : PBO
 *  Jurusan : IT
 *
 *  SOAL 2 : GREETING
 */

public class soal2 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {      
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        System.out.print("Please enter your name : ");
        String nama = input.readLine();
        System.out.println("Welcome, "+nama);
    }
}

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

Hello World

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

/**
*
* @author Fandy
*/

/*
* Nama : Fandy Adam
* Stambuk : E1E1 09 053
* Tugas Mata Kuliah : PBO
* Jurusan : IT
*
*
* SOAL 1 : HELLO WORLD
*/

public class soal1 {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
System.out.println("Hello World!");
System.out.println("My Name is Fandy Adam A. E. N.");
}
}


  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS