Jumat, 05 Desember 2014

Algoritma Game Perulangan

Pseudocode
Algoritma Game_kereta_pintar
Deklarasi
coba, coba2, coba3, coba4, angka, tanya, count = integer
Deskripsi

Algoritma Provider

Pseudocode
Algoritma Kartu_Provider_27
Deklarasi
paket, kode, yakin, sisapulsa, pulsa, harga1, harga2, harga3, harga4 = integer
Deskripsi
Begin
Writeln(“Masukkan Kode :  “);

Sabtu, 29 November 2014

Algoritma Game Perulangan

Pseudocode
Algoritma Game_kereta_mini
Deklarasi
tanya=interger
count=2=interger
Deskripsi
Begin
Writeln(“apakah kamu mau menjalankan keretamu?”);
Writeln(“1 : mau
                  2 : tidak mau”)
read(tanya);
if(tanya=1) {
                     writeln ("     **********************");
                     writeln ("    oo*********************");
                     writeln ("   oooo********************");
                     writeln ("    oo*********************");
                     writeln ("     **********************");
                     writeln ("     **********************");
                     writeln ("     **********************");
                     writeln ("     **********************");
                     writeln ("     **********************");
                     writeln ("     **********************");
                     writeln ("    oo*********************");
                     writeln ("   oooo******************");
                     writeln ("    oo***********");
                     writeln ("     ************");
                     writeln ("     ************");
                     writeln ("     ************");
                     writeln ("          **********************");
                     writeln ("         oo*********************");
                     writeln ("        oooo********************");
                     writeln ("         oo*********************");
                     writeln ("          **********************");
                     writeln ("          **********************");
                     writeln ("          **********************");
                     writeln ("          **********************");
                     writeln ("          **********************");
                     writeln ("          **********************");
                     writeln ("         oo*********************");
                     writeln ("        oooo******************");
                     writeln ("         oo***********");
                     writeln ("          ************");
                     writeln ("          ************");
                     writeln ("          ************");
                     writeln ("               **********************");
                     writeln ("              oo*********************");
                     writeln ("             oooo********************");
                     writeln ("              oo*********************");
                     writeln ("               **********************");
                     writeln ("               **********************");
                     writeln ("               **********************");
                     writeln ("               **********************");
                     writeln ("               **********************");
                     writeln ("               **********************");
                     writeln ("              oo*********************");
                     writeln ("             oooo******************");
                     writeln ("              oo***********");
                     writeln ("               ************");
                     writeln ("               ************");
                     writeln ("               ************");
                     writeln ("          **********************");
                     writeln ("         oo*********************");
                     writeln ("        oooo********************");
                     writeln ("         oo*********************");
                     writeln ("          **********************");
                     writeln ("          **********************");
                     writeln ("          **********************");
                     writeln ("          **********************");
                     writeln ("          **********************");
                     writeln ("          **********************");
                     writeln ("         oo*********************");
                     writeln ("        oooo******************");
                     writeln ("         oo***********");
                     writeln ("          ************");
                     writeln ("          ************");
                     writeln ("          ************");
                     writeln ("     **********************");
                     writeln ("    oo*********************");
                     writeln ("   oooo********************");
                     writeln ("    oo*********************");
                     writeln ("     **********************");
                     writeln ("     **********************");
                     writeln ("     **********************");
                     writeln ("     **********************");
                     writeln ("     **********************");
                     writeln ("     **********************");
                     writeln ("    oo*********************");
                     writeln ("   oooo******************");
                     writeln ("    oo***********");
                     writeln ("     ************");
                     writeln ("     ************");
                     writeln("     ************");
              count++;
}
while (count>1);
}
else {
       writeln (
"     **********************");
                     writeln ("    oo*********************");
                     writeln ("   oooo********************");
                     writeln ("    oo*********************");
                     writeln ("     **********************");
                     writeln ("     **********************");
                     writeln ("     **********************");
                     writeln ("     **********************");
                     writeln ("     **********************");
                     writeln ("     **********************");
                     writeln ("    oo*********************");
                     writeln ("   oooo******************");
                     writeln ("    oo***********");
                     writeln ("     ************");
                     writeln ("     ************");
                     writeln("     ************");
}

end

Flowchart



Console

Algoritma Provider

Pseudocode
Algoritma Kartu_Provider_27
Deklarasi
paket, kode, yakin = interger
Deskripsi

Begin
Writeln(“Masukkan Kode :  “);
Read(kode);
if (kode = 2727)  {
writeln(“1 : BBM
                  2 : Line
                  3 : Whatsapp
                  4 : Twitter & Facebook”);
writeln(“masukkan paket yang dipilih : “);
Read(paket);
if (paket=1) {
writeln(“apakah anda yakin memilih paket bbm?”);
read(yakin);
                if (yakin=1)  {
                writeln(“terdaftar paket bbm”);
                }
                else {
                writeln(“baiklah”);
                }
}
else if(paket=2) {
writeln(“apakah anda yakin memilih paket Line?”);
read(yakin);
                if (yakin=1)  {
                writeln(“terdaftar paket Line”);
                }
                else {
                writeln(“baiklah”);
                }
}
else if(paket=3) {
writeln(“apakah anda yakin memilih paket Whatsapp?”);
read(yakin);
                if (yakin=1)  {
                writeln(“terdaftar paket Whatsapp”);
                }
                else {
                writeln(“baiklah”);
                }
}
else if(paket=4) {
writeln(“apakah anda yakin memilih paket Twitter & Facebook?”);
read(yakin);
                if (yakin=1)  {
                writeln(“terdaftar paket Twitter & Facebook”);
                }
                else {
                writeln(“baiklah”);
                }
}
}
else {
Writeln(“paket tidak tersedia”);
}
else {
Writeln(“kode tidak dikenal”);
}


end


Flowchart Provider


Console Provider

Kamis, 27 November 2014

Algoritma Kalkulator Fisika

PSEUDOCODE
AlgoritmaMenghitung_Rumus_Fisika
{Menghitung rumus usaha dan massa jenis dengan menginput gaya, jarak, massa jenis dan volume suatu benda}
Deklarasi
F,s, W, m,v, rho = double
Deskripsi
Begin
Begin Program_rho
                        Writeln(“ massa : “);   
                        Read(m);
                        Writeln(“ volume : “);
                        Read(v);
                        Writeln(“ Massa jenis : “);
                        rho           m/v;
                        Read(rho);
                        Print(rho);
End Program_rho

Begin Program_usaha
Writeln(“ besargaya : “);
                Read(F);
                Writeln(“ jarak : “);
                Read(s);
                Writeln(“ Besarusaha : “);
                W           F*s;
                Read(W);
                Print(W);
End Program_usaha

End


Flowchart



Console

Algoritma Sistem Kasir Reservasi Tour

PSEUDOCODE
AlgoritmaKasir_Reservasi_Tour
{Menghitung total pembayaransecaraotomatisdenganmenginputjumlah tourist}

Deklarasi
nama, no_identitas, telp, tanggal = string
jumlaha, jumlahb, jumlahc, jumlahd, jumlahe, total, bayar, kembali = integer
Bali=1000000=integer
Lombok=1500000=integer
Kupang=1800000=integer
Raja Ampat=5000000=integer
Jogjakarta=500000=integerDeskripsi
Begin
            Writeln(“ NamaRombongan : “);
            Read(nama);
            Writeln(“ No. Identitas : “);
            Read(no_identitas);
            Writeln(“ Telepon : “);
            Read(telp);
            Writeln(“ Tanggalreservasi : “)
            Read(tanggal)
            Writeln(“ Bali : “);
            Read(jumlaha);
            Writeln(“ Lombok : “);
            Read(jumlahb);
            Writeln(“ Kupang : “);
            Read(jumlahc);
            Writeln(“ Raja Ampat : “);
            Read(jumlahd);
            Writeln(“ Jogjakarta : “);
            Read(jumlahe);
            total            a*jumlaha+Bali*jumlahb+Lombok*jumlahc+Kupang*jumlahd+RajaAmpat*jumlahe+Jogjakarta;
            Read(total);
            Writeln(“ Uang yang dibayar : “);
            Read(bayar);
            Writeln(“ Uang yang kembali : “);
            kembalibayar-total;
            Read(kembali);
            Writeln( nama, no_identitas, telp, tanggal, total, bayar, kembali );
End

Flowchart




Console