Selasa, 17 Mei 2011

Determinant in Java

Just sharing the code for all,
You can copy an existing program code below




import java.io.*;

class menudeterminan
{
    public static void main(String[] args)throws Exception
    {
        DataInputStream data = new DataInputStream (System.in);
        System.out.println ("\n===================================");
        System.out.println ("||Mencari Determinan dari Matriks||");
        System.out.println ("===================================");
        System.out.println ("|| 1. Matriks 2x2                ||");
        System.out.println ("|| 2. Matriks 3x3                ||");
        System.out.println ("===================================\n");
        System.out.print ("Masukkan pilihan anda : ");
        int pil = Integer.parseInt(data.readLine());

        if (pil==1)
        {
            System.out.println ("\nAnda Memilih Untuk Mencari Determinan 2x2");
            System.out.println ("\n===================================");
            System.out.println ("Mencari Determinan dari Matriks 2x2");
            System.out.println ("===================================\n");
            System.out.println ("Masukkan Data anggota Matriks 2x2 : ");
            int n = 2;
            int Matriks[][]=new int [n][n];
            for (int i=0;i<n ;i++ )
            {
                for (int j=0;j<n ;j++ )
                {
                    System.out.print("posisi ("+(i+1)+","+(j+1)+") adalah : ");
                    Matriks[i][j]=Integer.parseInt(data.readLine());
                }
            }
            System.out.println ("\n");
        

            int a = Matriks[0][0];
            int b = Matriks[0][1];
            int c = Matriks[1][0];
            int d = Matriks[1][1];
            System.out.println ("Maka Bentuk Matriksnya adalah sebagai berikut : \n");
            System.out.println ("( "+a+"  "+b+" )");
            System.out.println ("( "+c+"  "+d+" )\n");
        
            System.out.print ("Maka Determinan dari Matriks nya adalah : "+((a*d)-(b*c))+"\n");
        }
        else if (pil==2)
        {
            System.out.println ("\nAnda Memilih Untuk Mencari Determinan 3x3");
            System.out.println ("\n===================================");
            System.out.println ("Mencari Determinan dari Matriks 3x3");
            System.out.println ("===================================\n");
            System.out.println ("Masukkan Data anggota Matriks 3x3 : ");
            int n = 3;
            int Matriks[][]=new int [n][n];
            for (int i=0;i<n ;i++ )
            {
                for (int j=0;j<n ;j++ )
                {
                    System.out.print("posisi ("+(i+1)+","+(j+1)+") adalah : ");
                    Matriks[i][j]=Integer.parseInt(data.readLine());
                }
            }
            System.out.println ("\n");
            int a = Matriks[0][0];
            int b = Matriks[0][1];
            int c = Matriks[0][2];
            int d = Matriks[1][0];
            int e = Matriks[1][1];
            int f = Matriks[1][2];
            int g = Matriks[2][0];
            int h = Matriks[2][1];
            int i = Matriks[2][2];
            System.out.println ("Maka Bentuk Matriksnya adalah sebagai berikut : \n");
            System.out.println ("( "+a+" "+b+" "+c+" )");
            System.out.println ("( "+d+" "+e+" "+f+" )");
            System.out.println ("( "+g+" "+h+" "+i+" )\n");
        
            System.out.print ("Maka Determinan dari Matriks nya adalah : "+((a*e*i)+(b*f*g)+(c*d*h)-(c*e*g)-(a*f*h)-(b*d*i))+"\n");
        }
        else
            System.out.println ("\nMaaf Tidak Ada Pilihan "+pil+" Dalam Menu\n");
    }
}

Rabu, 04 Mei 2011

Simple Branching Program for Python

Just sharing the code for all,
You can copy an existing program code below 

print "|#################################################|"
print "|                                                 |"
print "|            PROGRAM GAJI PEGAWAI NEGERI          |"
print "|                                                 |"
print "|#################################################|"
print "|                             created by Luthfirez|"
print "|#################################################|"
print ""

nama  = raw_input ("Nama                : ")
nip   = raw_input ("Nomor Induk Pegawai : ")
gol   = raw_input ("Gol (I/II/II)       : ")
status= raw_input ("Status (K/BK)       : ")
anak  = input     ("Jumlah Anak         : ")

print ""

# Untuk Mendapatkan Gaji Pokok
if   gol == "I":
    gapok = 1000
elif gol == "II":
    gapok = 1500
elif gol == "III":
    gapok = 2000
else :
    print "Maaf Data Tidak Ada"

# Untuk Mendapatkan Tunjangan Suami/Istri
if status == "K":
    tunj = gapok*0.05
elif status == "BK":
    tunj = gapok*0
else :
    print "Massa gak"

# Untuk Mendapatkan Tunjangan Anak
tunjanak = gapok*anak*0.025

# Untuk Mendapatkan Gaji Kotor
gajikotor = gapok+tunj+tunjanak

# Untuk Mendapatkan Pajak
if gol=="I" and status=="K":
    pajak = 0.02*gapok
elif gol=="I" and status=="BK":
    pajak = 0.025*gapok
elif gol=="II" and status=="K":
    pajak = 0.03*gapok
elif gol=="II" and status=="BK":
    pajak = 0.035*gapok
elif gol=="III" and status=="K":
    pajak = 0.04*gapok
elif gol=="III" and status=="BK":
    pajak = 0.045*gapok
else :
    print "Maaf Data Tidak Ada"

print "####################################################"
print "#              Maka Informasi Untuk Anda           #"
print "####################################################"
print ""
print "Nama                                : ",nama
print "NIP                                 : ",nip
print "Golongan                            : ",gol
print "Status                              : ",status
print "Jumlah Anak                         : ",anak
print "Gaji Pokok                          :  Rp.",gapok
print "Tunjangan Suami/Istri               :  Rp.",tunj
print "Tunjangan Anak                      :  Rp.",tunjanak
print "Gaji Kotor                          :  Rp.",gajikotor
print "Pajak                               :  Rp.",pajak
print "Total Gaji Bersih (Gaji Kotor-Pajak):  Rp.",gajikotor-pajak
print ""
print "###################################################"

and the result will be as follows



 

Sample Looping Programs for Python 2

Just sharing the code for all,
You can copy an existing program code below

a = input ("enter the initial number : ")
b = input ("want to repeat how many times? : ")
c = str(a)
t = 10
while 0<=b:
    while a<=b-1:
        print c
        a = a+1
        d = str(a)
        c = c+d
   
    print c[:b]
    b=b-1

and the result will be as follows

Sample Looping Programs for Python 1

Just sharing the code for all,
You can copy an existing program code below

a = raw_input("insert the word: ")
b = input("Want to repeat how many times?")
c = 1
while 1<=b:
    while c<=b-1:
        print a*c
        c=c+1
    print a*b
    b=b-1

and the result will be as follows

Jumat, 22 April 2011

Display the Ranking SEO (SEO Stats) in Blogspot

View ratings for our blog is also an important issue which we must show in our blog. it as a consideration visitors to visit the blog we have created, the higher the ranking of your blog the higher the confidence visitors to visit our blog.

As for steps to display in blogspot seo rankings are as follows:

1. websites that serve this facility for one of them is http://www.mypagerank.net , you try to visit the website first.

2. After that try you select SEO Stats on the free services that exist on the right website.



3. In this section, you are requested to write down the address of your blog. after that you can design your own SEO Stats you wish to view, or change to display in terms of its color in accordance with the wishes and do not forget to enter a code and Submit

 
4. Next you'll be given the html script that you can copy to your blog


5. the result is as follows

 
make it easy? try at home