Kamis, 16 Juni 2011

Program Single Linked List

#include <iostream.h>
#include <stdlib.h>
#include <malloc.h>
#include <conio.h>

#define Nil NULL
#define info(P) P->info
#define next(P) P->next
#define First(L) (L)

typedef int InfoType;
typedef struct telmlist *address;
typedef struct telmlist
{
InfoType info;
   address next;
}elmtlist;

typedef address list;

void CiptaSenarai(list *L)
{
First(*L) = Nil;
}

list NodBaru(int m)
{
list n;
   n = (list) malloc(sizeof(elmtlist));
   if (n !=NULL)
   {
    info(n) = m;
      next(n) = Nil;
   }

   return n;
}

void SisipSenarai (list *L, list t, list p)
{
if (p == Nil)
   {
    t->next = *L;
      *L = t;
   }
   else
   {
    t->next = p->next;
      p->next = t;
   }
}

void CetakSenarai (list L)
{
list ps;
   for (ps=L; ps!=Nil; ps=ps->next)
   {
    cout<<" "<<info(ps)<<" -->";
   }
   cout<<" NULL"<<endl;
}

int main()
{
list pel;
   list n;
   int i,k,nilai;

   CiptaSenarai(&pel);
   cout<<"Masukkan Banyak Data = ";
   cin>>k;
   for (i=1; i<=k; i++)
   {
    cout<<"Masukkan Data Senarai ke-"<<i<<" = ";
      cin>>nilai;
      n = NodBaru(nilai);
      SisipSenarai (&pel, n, NULL);
   }

   CetakSenarai(pel);
   getch();
   return 0;
}

Hasilnya inputkan data sendiri ya....!! hohaheh

Rabu, 15 Juni 2011

Program Single Linked List Nilai Terbesar & Terkecil

#include <iostream.h>
#include <stdlib.h>
#include <malloc.h>
#include <conio.h>

#define Nil NULL
#define info(P) P->info
#define next(P) P->next
#define First(L) (L)

typedef int InfoType;
typedef struct telmlist *address;
typedef struct telmlist
{
InfoType info;
   address next;
}elmtlist;

typedef address list;

void CiptaSenarai(list *L)
{
First(*L) = Nil;
}

list NodBaru(int m)
{
list n;
   n = (list) malloc(sizeof(elmtlist));
   if (n !=NULL)
   {
    info(n) = m;
      next(n) = Nil;
   }

   return n;
}

void SisipSenarai (list *L, list t, list p)
{
if (p == Nil)
   {
    t->next = *L;
      *L = t;
   }
   else
   {
    t->next = p->next;
      p->next = t;
   }
}

void CetakSenarai (list L)
{
list ps;
   for (ps=L; ps!=Nil; ps=ps->next)
   {
    cout<<" "<<info(ps)<<" -->";
   }
   cout<<" NULL"<<endl;
}

InfoType Max(list L)
{
address Pmax,Pt;

   Pmax = First(L);

   if (next(Pmax) == Nil)
   {
    return (info(Pmax));
   }
   else
   {
    Pt = next(Pmax);
      while (Pt != Nil)
      {
      if (info(Pmax) < info(Pt))
         {
          Pmax = Pt;
         }
         else
         {
          Pt = next(Pt);
         }
      }

      return (info(Pmax));
   }
}

InfoType Min(list L)
{
address Pmin,Pt;

   Pmin = First(L);

   if (next(Pmin) == Nil)
   {
    return (info(Pmin));
   }
   else
   {
    Pt = next(Pmin);
      while (Pt != Nil)
      {
      if (info(Pmin) > info(Pt))
         {
          Pmin = Pt;
         }
         else
         {
          Pt = next(Pt);
         }
      }

      return (info(Pmin));
   }
}

void main()
{
list pel;
   list n;
   int i,k,nilai,maks,min;

   CiptaSenarai(&pel);
   cout<<"Masukkan Banyak Data = ";
   cin>>k;
   for (i=1; i<=k; i++)
   {
    cout<<"Masukkan Data Senarai ke-"<<i<<" = ";
      cin>>nilai;
      n = NodBaru(nilai);
      SisipSenarai (&pel, n, NULL);
   }

   cout<<endl;
   CetakSenarai(pel);
   maks = Max(pel);
   min = Min(pel);

   cout<<endl;
   cout<<"Nilai terbesar : "<<maks;
   cout<<endl;
   cout<<"Nilai Terkecil : "<<min;
   getch();
}

Hasilnya inputkan data sendiri ya???? hhehee

Senin, 13 Juni 2011




Cewek Komersil

Yen metunangan ajak iluh ..
Ngae beli dadi frustasi..
Nagih kene lan nagih keto..
Ngae dompet beline puyung..

Sebilang pesu ngajak iluh..
Mirib beli kal bunuh diri..
Yening iluh nagih melali..
Beli harus ngabe mobil..

Dije beli ngalih pang nyidang ngabe mobil...
Dije beli nyilih mobil kelas tinggi..

Uli pidan beli sube nawang... iluh cewek Komersil..
Matan iluh tuwah dimobil... iluh cewek Matre....2x

Duang bulan iluh sing ade kabar..
Jani irage buin ketemu..
Minab irage mule jodoh..
Beli buin nepukin iluh..

Iluh maekin beli... beli sok jual mahal..
Beli sing nganggoang iluh... Karne...

Uli pidan beli sube nawang... iluh cewek Komersil..
Matan iluh tuah dimobil.. iluh cewek Matre.....2x

Jumat, 10 Juni 2011

My name is KEJU

Childhood before I named my first KEJU invoked ADE. I likes to play the kite so that my skin burnt by the sun and colored black. Before named KEJU I was called JUWET (name of fruit), namely that black JUWET who first called by my uncle and for some reason I am for my friends called me with the title JUWET. In elementary school my class had been called JUWET but over time the name was changed to KEJU because all my friends call me JU, JU, JU, and eventually turned into KEJU. after I was in junior high school I never hope to change the nickname again to ADE but the effort was in vain because my friends already know my name as the KEJU. Finally fixed KEJU nickname I use to this day. I am proud to have a nickname by the name of the KEJU because I could have lots of friends.

That's why I brief my story can be named KEJU.
why I make this story because to answer the question that many friends who ask why my name could KEJU

Sabtu, 14 Mei 2011

Organisasi & Arsitektur Komputer

UTSORKOM_STIKOM_100010757

Jumat, 13 Mei 2011

Video ini di buat untuk mengenang seorang sahabat yg telah pergi untuk selamanya.... ini lirik lagunya:

Sahabat 

Ketika kau menutup mata... 
Ku tak tau apa yang terjadi dengan sahabatku..
Hari-hari terasa sepi.. 
Ketika kau pergi tinggalkan ku untuk selamanya..

Begitu cepatnya kau pergi.. 
Terbang bersama bidadari lenyap ditelan bumi..
Tetes air mata tak henti.. 
Mengingat tragedi yang terjadi lukai hati ini..

Sampai kapan ku harus menangis..
Meratapi semua yang terjadi...... yang terjadi.... hhhhooooooooooooo....

Selamat jalan sahabatku.. semoga kau damai disana..
Ku slalu mendoakanmu berbahagia dan tersenyum...
Selamat jalan sahabatku.. semoga kau damai disana..
Ku slalu merindukanmu berbahagia dan tersenyumlah.....
 

Selasa, 12 April 2011

Tugas Kampus

Kumpulan tugas-tugas kampus......
Yang pertama 
Algoritma Program Penjumlahan Matriks 3x3, 2x1, 3x2


Matrik 3x3
#include <iostream.h>
#include <conio.h>

#define Nmaks 10
typedef int matrik[Nmaks][Nmaks];

void main()
{
    int n,i,j;
   matrik A,B,C;

   cout<<"Program Penjumlahan Matrik 3x3"<<endl;
   cout<<"=============================="<<endl;
   cout<<endl;

   n=3;

   cout<<"Masukkan Entry Matrik A"<<endl<<endl;
   for(i=1;i<=n;i++)
       {
          for(j=1;j<=n;j++)
             {
               cout<<"A"<<"["<<i<<"]"<<"["<<j<<"]"<<" = ";
               cin>>A[i][j];
            }
      }
   cout<<endl;
   cout<<"Masukkan Entry Matrik B"<<endl<<endl;
   for (i=1;i<=n;i++)
       {
          for (j=1;j<=n;j++)
             {
               cout<<"B"<<"["<<i<<"]"<<"["<<j<<"]"<<" = ";
               cin>>B[i][j];
            }
       }


   //penjumlahan matrik C=A+B
   for(i=1;i<=n;i++)
       {
          for(j=1;j<=n;j++)
             {
                C[i][j]=A[i][j]+B[i][j];
            }
      }

   clrscr();

   cout<<"Penjumlahan Matrik A dan B"<<endl;


   //output matrik A

   gotoxy(1,6);
   cout<<"A = ";
   for(i=1;i<=n;i++)
       {
          for(j=1;j<=n;j++)
             {
                gotoxy(2+4*j,2+2*i);
               cout<<A[i][j];
            }
      }

   //output matrik B

   gotoxy(1,14);
   cout<<"B = ";
   for(i=1;i<=n;i++)
       {
          for(j=1;j<=n;j++)
             {
                gotoxy(2+4*j,5+2*i+5);
               cout<<B[i][j];
            }
      }

   //output matrik C = A + B

   gotoxy(1,22);
   cout<<"C = ";
   for(i=1;i<=n;i++)
       {
          for(j=1;j<=n;j++)
             {
                gotoxy(2+4*j,8+2*i+10);
               cout<<A[i][j];
            }
      }

   gotoxy(18,22);
   cout<<" + ";
   for(i=1;i<=n;i++)
       {
            for(j=1;j<=n;j++)
             {
                gotoxy(20+4*j,8+2*i+10);
               cout<<B[i][j];
            }
      }

   //output hasil
   gotoxy(38,22);
   cout<<"=";
   for(i=1;i<=n;i++)
       {
            for(j=1;j<=n;j++)
             {
                gotoxy(40+4*j,8+2*i+10);
               cout<<C[i][j];
            }
      }
      getch();
}


 Matrik 2x1

#include <iostream.h>
#include <conio.h>

#define Nmaks 10
typedef int matrik[Nmaks][Nmaks];

void main()
{
    int n,i,j,v;
   matrik A,B,C;

   cout<<"Program Perkalian Matrik 2x1"<<endl;
   cout<<"=============================="<<endl;
   cout<<endl;

   n=2;
   v=1;

   cout<<"Masukkan Entry Matrik A"<<endl<<endl;
   for(i=1;i<=n;i++)
       {
          for(j=1;j<=v;j++)
             {
               cout<<"A"<<"["<<i<<"]"<<"["<<j<<"]"<<" = ";
               cin>>A[i][j];
            }
      }
   cout<<endl;
   cout<<"Masukkan Entry Matrik B"<<endl<<endl;
   for (i=1;i<=n;i++)
       {
          for (j=1;j<=v;j++)
             {
               cout<<"B"<<"["<<i<<"]"<<"["<<j<<"]"<<" = ";
               cin>>B[i][j];
            }
       }


   //penjumlahan matrik C=A+B
   for(i=1;i<=n;i++)
       {
          for(j=1;j<=v;j++)
             {
                C[i][j]=A[i][j]*B[i][j];
            }
      }

   clrscr();

   cout<<"Perkalian Matrik A dan B"<<endl;


   //output matrik A

   gotoxy(1,6);
   cout<<"A = ";
   for(i=1;i<=n;i++)
       {
          for(j=1;j<=v;j++)
             {
                gotoxy(2+4*j,2+2*i);
               cout<<A[i][j];
            }
      }

   //output matrik B

   gotoxy(1,14);
   cout<<"B = ";
   for(i=1;i<=n;i++)
       {
          for(j=1;j<=v;j++)
             {
                gotoxy(2+4*j,5+2*i+5);
               cout<<B[i][j];
            }
      }

   //output matrik C = A * B

   gotoxy(1,22);
   cout<<"C = ";
   for(i=1;i<=n;i++)
       {
          for(j=1;j<=v;j++)
             {
                gotoxy(2+4*j,8+2*i+10);
               cout<<A[i][j];
            }
      }

   gotoxy(18,22);
   cout<<" * ";
   for(i=1;i<=n;i++)
       {
            for(j=1;j<=v;j++)
             {
                gotoxy(20+4*j,8+2*i+10);
               cout<<B[i][j];
            }
      }

   //output hasil
   gotoxy(38,22);
   cout<<"=";
   for(i=1;i<=n;i++)
       {
            for(j=1;j<=v;j++)
             {
                gotoxy(40+4*j,8+2*i+10);
               cout<<C[i][j];
            }
      }
      getch();
}

Matrik 3x2

#include <iostream.h>
#include <conio.h>

#define Nmaks 10
typedef int matrik[Nmaks][Nmaks];

void main()
{
    int n,i,j,v;
   matrik A,B,C;

   cout<<"Program Perkalian Matrik 2x1"<<endl;
   cout<<"=============================="<<endl;
   cout<<endl;

   n=3;
   v=2;

   cout<<"Masukkan Entry Matrik A"<<endl<<endl;
   for(i=1;i<=n;i++)
       {
          for(j=1;j<=v;j++)
             {
               cout<<"A"<<"["<<i<<"]"<<"["<<j<<"]"<<" = ";
               cin>>A[i][j];
            }
      }
   cout<<endl;
   cout<<"Masukkan Entry Matrik B"<<endl<<endl;
   for (i=1;i<=n;i++)
       {
          for (j=1;j<=v;j++)
             {
               cout<<"B"<<"["<<i<<"]"<<"["<<j<<"]"<<" = ";
               cin>>B[i][j];
            }
       }


   //penjumlahan matrik C=A+B
   for(i=1;i<=n;i++)
       {
          for(j=1;j<=v;j++)
             {
                C[i][j]=A[i][j]*B[i][j];
            }
      }

   clrscr();

   cout<<"Perkalian Matrik A dan B"<<endl;


   //output matrik A

   gotoxy(1,6);
   cout<<"A = ";
   for(i=1;i<=n;i++)
       {
          for(j=1;j<=v;j++)
             {
                gotoxy(2+4*j,2+2*i);
               cout<<A[i][j];
            }
      }

   //output matrik B

   gotoxy(1,14);
   cout<<"B = ";
   for(i=1;i<=n;i++)
       {
          for(j=1;j<=v;j++)
             {
                gotoxy(2+4*j,5+2*i+5);
               cout<<B[i][j];
            }
      }

   //output matrik C = A * B

   gotoxy(1,22);
   cout<<"C = ";
   for(i=1;i<=n;i++)
       {
          for(j=1;j<=v;j++)
             {
                gotoxy(2+4*j,8+2*i+10);
               cout<<A[i][j];
            }
      }

   gotoxy(18,22);
   cout<<" * ";
   for(i=1;i<=n;i++)
       {
            for(j=1;j<=v;j++)
             {
                gotoxy(20+4*j,8+2*i+10);
               cout<<B[i][j];
            }
      }

   //output hasil
   gotoxy(38,22);
   cout<<"=";
   for(i=1;i<=n;i++)
       {
            for(j=1;j<=v;j++)
             {
                gotoxy(40+4*j,8+2*i+10);
               cout<<C[i][j];
            }
      }
      getch();
}

 Hasilnya inputkan angka sendiri -sendiri ya....!! hahaha