This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

Ad

Tampilkan postingan dengan label Programming. Tampilkan semua postingan
Tampilkan postingan dengan label Programming. Tampilkan semua postingan

Sabtu, 14 Juli 2012

Menampilkan Bilangan Terbesar, Terkecil dengan Java Programming


import java.util.Scanner;

public class nomor2 {
    public static void main (String []args) {
    Integer totalgenap,totalganjil,totalpositiv,totalnegatif,nilai;
    int max=Integer.MIN_VALUE;
    int min=Integer.MAX_VALUE;
    Scanner input = new Scanner(System.in);

    totalgenap=0;
    totalganjil=0;
    totalpositiv=0;
    totalnegatif=0;

    do {
        System.out.print("Nilai : ");
        nilai=input.nextInt();
        if (nilai%2==0)
            totalgenap+=nilai;
        else
            totalganjil+=nilai;

        if (nilai>0)
            totalpositiv+=nilai;
        else
            totalnegatif+=nilai;

        if(nilai>max)
            max=nilai;
        if(nilai<min)
            min=nilai;

    } while (nilai!=0);

        System.out.printf("\nBilangan Terbesar           : %d\n",max);
        System.out.printf("Bilangan Terkecil           : %d\n",min);
        System.out.printf("Total Nilai Bilangan Ganjil : %d\n", totalganjil);
        System.out.printf("Total Nilai Bilangan Genap  : %d\n", totalgenap);
        System.out.printf("Total Nilai Bilangan Positif: %d\n", totalpositiv);
        System.out.printf("Total Nilai Bilangan Negatif: %d\n", totalnegatif);
        System.out.printf("\n");
    }
}


Contoh outputnya :
 

Source Code Menampilkan Bilangan Genap, Ganjil, Positif, Negatif dengan Java

import java.util.Scanner;

public class nomor1 {
    public static void main (String []args) {
    Integer genap,ganjil,positiv,negatif,nilai,total;
    Scanner input = new Scanner(System.in);

    genap=0;
    ganjil=0;
    positiv=0;
    negatif=0;
    total=0;

    do {
        System.out.print("Nilai : ");
        nilai=input.nextInt();
        if (nilai%2==0)
            genap++;
        else
            ganjil++;
        if (nilai>0)
            positiv++;
        else
            negatif++;

        total++;
    } while (nilai!=0);
        System.out.printf("\nBanyaknya Bilangan Ganjil  : %d\n", ganjil);
        System.out.printf("Banyaknya Bilangan Genap   : %d\n", genap-1);
        System.out.printf("Banyaknya Bilangan Positiv : %d\n", positiv);
        System.out.printf("Banyaknya Bilangan Negatif : %d\n", negatif-1);
        System.out.printf("Total Banyaknya Bilangan   : %d\n", total-1);
        System.out.printf("\n");
    }
}


Contoh Outputnya :

Minggu, 04 Maret 2012

Simple Text Editor With VB.Net



Teks editor sederhana dengan fungsi fontstyle yang dapat diubah apakah itu bold, italic, underline atau regular.
serta menampilkan waktu dan tanggal dari sistem
Download : Disini

Iseng With Notepad


Hallo kawan
Kzkz, bosen dengan belajar, mau iseng? Yuk, kita pakai cara sederhana saja untuk ngisengin teman kita sendiri.
Tapi jangan anda coba trik ini di komputer anda, klo dicoba berarti anda mengisengin diri anda sendiri & dapat dibilang anda melakukan tindakan yang stup*d.. Hehe.. Wkwk..
Lets begin! Pastikan Anda Mengetik Dengan Benar Script Dibawah Ini! Copy Paste Kadang Tidak Berhasil Dikarenakan Perbedaan Tanda Petik ( ” ” ) Pada Notepad, Untuk Lebih Fix Bisa Pake TextPad


1. Mengeject CD-Drive Terus Menerus

Set oWMP = CreateObject(“WMPlayer.OCX.7″)
Set colCDROMs = oWMP.cdromCollection
do
if colCDROMs.Count >= 1 then
For i = 0 to colCDROMs.Count – 1
colCDROMs.Item(i).Eject
Next
For i = 0 to colCDROMs.Count – 1
colCDROMs.Item(i).Eject
Next
End If
wscript.sleep 5000
loop
Kemudian save dengan “SUKASUKAANDA.VBS” & Berikan keteman Anda

2. Tombol Enter Terus Menerus

Set wshShell = wscript.CreateObject(“WScript.Shell”)
do
wscript.sleep 100
wshshell.sendkeys “~(enter)”
loop
Kemudian save dengan “SUKASUKAANDA.VBS” & Berikan keteman Anda

3. Pesan Lambat Notepad “Hello, how are you? I am good thanks!”

WScript.Sleep 180000
WScript.Sleep 10000
Set WshShell = WScript.CreateObject(“WScript.Shell”)
WshShell.Run “notepad”
WScript.Sleep 100
WshShell.AppActivate “Notepad”
WScript.Sleep 500
WshShell.SendKeys “Hel”
WScript.Sleep 500
WshShell.SendKeys “lo ”
WScript.Sleep 500
WshShell.SendKeys “, ho”
WScript.Sleep 500
WshShell.SendKeys “w a”
WScript.Sleep 500
WshShell.SendKeys “re ”
WScript.Sleep 500
WshShell.SendKeys “you”
WScript.Sleep 500
WshShell.SendKeys “? ”
WScript.Sleep 500
WshShell.SendKeys “I a”
WScript.Sleep 500
WshShell.SendKeys “m g”
WScript.Sleep 500
WshShell.SendKeys “ood”
WScript.Sleep 500
WshShell.SendKeys ” th”
WScript.Sleep 500
WshShell.SendKeys “ank”
WScript.Sleep 500
WshShell.SendKeys “s! “
Kemudian save dengan “SUKASUKAANDA.VBS” & Berikan keteman Anda

4. Backspace
MsgBox “Maaf, Anda Harus Mengulang Kembali”
Set wshShell =wscript.CreateObject(“WScript.Shell”)
do
wscript.sleep 100
wshshell.sendkeys “{bs}”
loop
Kemudian save dengan “SUKASUKAANDA.VBS” & Berikan keteman Anda

5. Membuka Calculator Terus Menerus
@ECHO off
:top
START %SystemRoot%\system32\cacl.exe
GOTO top
Kemudian save dengan “SUKASUKAANDA.BAT” & Berikan keteman Anda

6. Iseng Dengan Keyboard
Set wshShell = wscript.CreateObject(“WScript.Shell”)
do
wscript.sleep 100
wshshell.sendkeys “Maaf, Keyboard Tidak Berfungsi! Harap Diperbaiki”
loop
Kemudian save dengan “SUKASUKAANDA.VBS” & Berikan keteman Anda

7. Shutdown Computer
@echo off
msg * Komputer Anda Terinfeksi Virus
shutdown -c “Error! Virus Menyebar Keseluruh System!” -s -t 0
Kemudian save dengan “SUKASUKAANDA.BAT” & Berikan keteman Anda
==================================================
Note: Bosen gak ada kerjaan didepan komputer, terlintas untuk berbagi cara ngisengin teman. Teringat masa lalu waktu masih suka ngisengin temen² dengan trik ini
Semoga Bermanfaat Ya All.. Salam Hangat Dari Saya.. Kzkz..
Silakan Dikembangkan Sendiri Ide Ide Yang Lainnya