Nonymo

Welcome

Nonymo

Welcome

Nonymo

Welcome

Nonymo

Welcome

Nonymo

Welcome

Nonymo

Welcome

Senin, 23 September 2013

Pembahasan Soal BNPCHS 2010


Assalamualaikum Wr.Wb

disini ane bakalan mosting sesuatu yang ada sangkut-pautnya ama pemrograman.. kalo ane pribadi sih,, kurang mendalami di bahasa pemrograman selain Java dan Pascal...

maka dari itu,, berhubung ane juga mau ngeshare ama yg mau belajar pemrograman..
nah ga usah basa-basi-basu-bakso lagi, langsung aje cekidot..

ane mau ngebahas soal yang diujikan dalam kompetisi BNPCHS di Binus.. gile aje yee baru babak penyisihan soalnya naujubile merepotkan..
inih dia tersangka...

SOAL BABAK PENYISIHAN BNPCHS 2010
1. TARIF TAXI
soalnye bise diliat dimari  :  Tarif Taxi

Penyelesaiannya :

import java.io.*;
/**
 *
 * @author renaldi
 */
public class taxi {

    /**

     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
        int a,b,t,j,jr,h;

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        System.out.print("Masukkan Jumlah Perhitungan Taksi:");
        t = Integer.parseInt(br.readLine());
        for (j=1;j<=t;j++) {
            System.out.print("Masukkan Harga Tarif Kurang dari 2 KM + Buka Pintu Taksi :");
            a = Integer.parseInt(br.readLine());
            System.out.print("Masukkan Harga Tarif Lebih dari 2 KM :");
            b = Integer.parseInt(br.readLine());
            System.out.print("Masukkan Jarak Perjalanan dalam meter :");
            jr = Integer.parseInt(br.readLine());

            h = a + b *(jr - 2000) / 100;

            if (jr>2000) {h = jr*b/100;}
            System.out.println("Harga Argo Bernilai:"+h);
        }
     }
 }


2. Lima Terbaik
soalnye bise diliat dimari  :  Lima Terbaik

Penyelesaian 


import java.io.*;
/**
 *
 * @author renaldi
 */
public class limaterbaik {
    public static void main(String[] args) throws IOException {
        int t, t2, i, i2, u1, u2, hsl, n;
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        System.out.print("Masukkan Jumlah Perhitungan 5 Angka Terbaik : ");
        t = Integer.parseInt(br.readLine());

        for (i=1;i<=t;i++) {
        System.out.print("Berapa Banyak angka yang akan di gunakan : ");
        t2 = Integer.parseInt(br.readLine());
        int[] a1 = new int[1000];
            for (i2=1; i2<=t2; i2++) {
            System.out.print("Masukkan Angka Ke "+ i2+" : ");
            a1[i2] = Integer.parseInt(br.readLine());
            }
            //Program Pemecah angka terbesar
            for (i2=1; i2<=5; i2++) {
                for (u1=i2+1;u1<=t2;u1++) {
                    if (a1[i2] < a1[u1]) {
                        u2 = a1[i2];
                        a1[i2] = a1[u1];
                        a1[u1] = u2;
                    }
                }
            }
                    hsl = 0;
                    for (i2=1;i2<=5;i2++) {
                        hsl = hsl + a1[i2];
                    }
             System.out.println("Nilai Akhir : "+ hsl);
            }
        }
}

3. Potong Gaji.
menurut ane soal ini lumayan sulit dibanding sebelumnya ,
bisa diliat dimari : Potong Gaji

Penyelesaian : 


import java.io.*;
/**
 *
 * @author renaldi
 */
public class potongaji {
    public static void main(String args[]) throws IOException {
        int loop, loop1, loop2, loop3, loop4, gantiloop2, gantiloop3, jkaryawan, M;

        BufferedReader input;
        InputStreamReader isr;
        isr = new InputStreamReader(System.in);
        input = new BufferedReader(isr);

        System.out.print("Masukkan Perulangan Potong Gaji : ");
        loop = Integer.parseInt(input.readLine());
        for (loop1=1;loop1<=loop;loop1++) {
            System.out.print("Masukkan Jumlah Karyawan : ");
            jkaryawan = Integer.parseInt(input.readLine());

            System.out.print("Total Gaji Maksimal : ");
            M = Integer.parseInt(input.readLine());
            int[] m = new int[10000];
            for (loop2=1; loop2<=jkaryawan; loop2++ )
            {
                //gantiloop2 = loop2 + 1;
                System.out.print("Masukkan Gaji Karyawan "+loop2+" : ");
                m[loop2] = Integer.parseInt(input.readLine());
            }

            // proses mencari H
            int gajiup, totalgaji=0, sisagajih = 0, gajipatungan=0, gajipotong=0;
            gajiup = M / jkaryawan;
            for (loop3=1; loop3<=jkaryawan; loop3++) {
                totalgaji= totalgaji + m[loop3];
            }
            if (totalgaji>M) {
            for (loop3=1; loop3<=jkaryawan; loop3++) {
                if (m[loop3]>M) {
                m[loop3] = m[loop3]/10;
                }

                if (m[loop3]<gajiup) {
                    sisagajih = sisagajih + gajiup - m[loop3];
                }
            }
            gajipatungan = sisagajih / (jkaryawan-1);
            gajipotong = gajiup + gajipatungan;

            } else {
            gajipotong = -1;
            }
            System.out.println("Total Gaji : "+totalgaji);
            System.out.println("Gaji Yang Harus Dipotong Sebesar : "+gajipotong);
        }
    }
}

Nah,, itu tadi adalah macam soal dan penyelesaian.. apabila ada pertanyaan silahkan tulis di komentar.
Salam Laes
Assalamualaikum Wr.Wb

Jumat, 15 Februari 2013

President Myanmmar site has Down By Anonymous Indonesia


Assalamualaikum
Dear Brother & Sister
We're Anonymous Indonesia

Today, at Friday - 15 February 2013
Myanmmar was started this war, and we wouldn't end it.
We're not playing game, We gave them their food , enjoy it , it free, it such a gift for you all.

This is not the first, but this is a thousands feed for U Myanmmar




Myanmmar Insulted Muslims, We won't Forgive them till they stop insulting Muslim.

We're Anonymous.
We're Legion.
We do not Forgive.
We do not Forget.
Expect Us.