b374k
v10
today : | at : | safemode : ON
> / home / facebook / twitter / youtube /
name author perms com modified label

Sistem Simulasi Antrian Parkir JEC pramana rwxr-xr-x 1 3:33 pm

Filename Sistem Simulasi Antrian Parkir JEC
Permission rw-r--r--
Author pramana
Date and Time 3:33 pm
Label
Action
Hi guys...
Aplikasi ini aq & tim q buat pakai Bahasa pemrograman C++. Aplikasi ini di buat setelah mempelajari salah satu materi Struktur data tentang Antrian, dari situ tim aq coba melihat dlm khidupan sehari dmna byk trdapat Antian untuk melakukan transaksi atau apalah..Contoh, bayar rekening listrik, ngantri sembako dll. Disini kami mengambil sistem simulasi antrian parkir di JEC, karena setiap ada kegiatan besar mis :pameran pasti pengunjungnya sangat banyak dan tentu pihak pengelola harus bekerja ekstra untuk melayani pengunjung slah satunya yaitu mengurus parkiran agar teratur. Nah ini nih sistem simulasi yg aku buat.



Download sistem simulasi

jangan lupa komentarnya ya guys ttg Aplikasi ini !!!
Matur nuhun ....

Program stack dengan bahasa C pramana rwxr-xr-x 0 1:43 am

Filename Program stack dengan bahasa C
Permission rw-r--r--
Author pramana
Date and Time 1:43 am
Label
Action
Tampilan program :







Download program

Semoga bermanfaat guys !!!


Pengertian Stack pramana rwxr-xr-x 0 1:33 am

Filename Pengertian Stack
Permission rw-r--r--
Author pramana
Date and Time 1:33 am
Label
Action
Stack adalah suatu bentuk khusus dari linier list, dengan operasi penyisipan dan penghapusan dibatasi hanya pada satu sisinya, yaitu puncak stack (TOP).

Elemen teratas dari stack dinotasikan sebagai TOP(S).
Untuk stack S, dengan S = [S1, S2, S3, ..., ST] maka TOP(S) = ST

Jumlah elemen didalam stack kita notasikan dengan NOEL(S).
NOEL(S) menghasilkan nilai integer untuk stack S = [S1, S2, S3, ..., ST] maka            NOEL (S) = T.

Operator penyisipan (insertion) : PUSH
Operator penghapusan (deletion) : POP
Operasi stack : LIFO (Last In First Out), yaitu : yang terakhir masuk yang pertama keluar.

Double link list pramana rwxr-xr-x 0 3:04 am

Filename Double link list
Permission rw-r--r--
Author pramana
Date and Time 3:04 am
Label
Action
#include<stdio.h>
#include<conio.h>
#include<iostream>

using namespace std;
struct node{
       int data;
       struct node *prev,*next,*info;
       };
       typedef struct node node;
       node *head,*last,*temp,*t,*p,search,item;
       int d;
       void addhead();
       void addmiddle();
       void addtail();
       void delhead();
       void delmiddle();
       void deltail();
       int Search();
       void disp();


int main(){
            int ch;
            while(1){
                     printf("\n1. add to head ");
                     printf("\n2. add to Middle ");
                     printf("\n3. add to tail ");
                     printf("\n4. Delete from head ");
                     printf("\n5. Delete from Middle ");
                     printf("\n6. Delete from tail ");
                     printf("\n7.earch");
                     printf("\n8. Exit");
                     printf("\nEnter your Choice : ");
                     scanf("%d",&ch);
            switch(ch){
                       case 1:
                            addhead();
                            disp();
                            break;
                       case 2:
                            addmiddle();
                            disp();
                            break;
                       case 3:
                            addtail();
                            disp();
                            break;
                       case 4:
                            delhead();
                            disp();
break;
case 5:
delmiddle();
disp();
break;
case 6:
deltail();
disp();
break;
case 7:
Search();
disp();
break;
case 8:
exit(0);
default:
printf("\nInvalid Choice");
}
getch();
}
}

void addhead()
{
temp=(node*)malloc(sizeof(node));
printf("\nEneter the Data : ");
scanf("%d",&temp->data);
temp->next=temp->prev=NULL;
if(head==NULL)
head=temp;
else
{
temp->next=head;
head->prev=temp;
head=temp;
}
}


void addmiddle()
{
int d;
temp=(node*)malloc(sizeof(node));
printf("\nEneter the Data : ");
scanf("%d",&temp->data);
temp->next=temp->prev=NULL;
if(head==NULL)
head=temp;
else
{
t=head;
printf("\nEnter the node after which insertion to be made : ");
scanf("%d",&d);
while(t!=NULL)
{
if(t->data==d)
{
temp->next=t->next;
temp->prev=t;
t->next=temp;
return;}
else
t=t->next;
}
printf("\nadd node not found");
}
}
void addtail()
{
node *t;
temp=(node*)malloc(sizeof(node));
printf("\nEneter the Data : ");
scanf("%d",&temp->data);
temp->next=temp->prev=NULL;
if(head==NULL)
head=temp;
else
{
t=head;
while(t->next!=NULL)
t=t->next;
t->next=temp;
temp->prev=t;
}
}
void delhaed()
{
if(head==NULL)
printf("\nList is Empty");
else
{
t=head;
printf("\nDeleted node is %d\n",t->data);
head=head->next;
head->prev=NULL;
free(t);
}
}
void delmiddle()
{
int d;
node *s,*n;
if(head==NULL)
printf("\nList is Empty");
else
{
printf("\nEnter  the node data to be deleted : ");
scanf("%d",&d);
if(head->data==d)
{
t=head;
head=head->next;
head->prev=NULL;
printf("\nDeleted node is %d\n",t->data);
free(t);
}
else
{
t=head;
while(t->next!=NULL)
{
if(t->data==d){
s=t;
printf("\nDeleted node is %d\n",s->data);
p=t->prev;
n=t->next;
p->next=t->next;
n->prev=p;
free(s);
}
else
{
p=p->next;
t=t->next;
}
}
}
} }
void deltail()
{
if(head==NULL)
printf("\nList is Empty");
else if(head->next==NULL)
{
t=head;
printf("\nDeleted node is %d\n",t->data);
head=NULL;
}
else
{
t=head;
while(t->next!=NULL)
{
t=t->next;
}
p=t->prev;
p->next=NULL;
printf("\nDeleted node is %d\n",t->data);
free(t);
}
}
//search

int Search()
{
    while(head!=NULL)
    {
        if(head->info=item){ // if the values match,
            //return head; // return the matching node.
        head=head->next; }// otherwise, move on
    }
    system("pause");
    return 0;
}

Meet 07 pramana rwxr-xr-x 0 3:03 am

Filename Meet 07
Permission rw-r--r--
Author pramana
Date and Time 3:03 am
Label
Action
Hi guys...
How are u ?
I hope you are okay :|

On this meet, we learn about Double link list...
This is forward from link list
On double link list, we didn't just to learn about how to make program but we was taught of Mr. Wahyu..
This meet is interest and very good, b'cz here we are given picture logic of a program
So, this is good for future development.
Ok, i hope this reference can help u guys
Read Double link list

Survived learn guys,
Spirit !!!

Circular pramana rwxr-xr-x 0 4:06 pm

Filename Circular
Permission rw-r--r--
Author pramana
Date and Time 4:06 pm
Label
Action
#include <iostream>
#include <cstdlib>

using namespace std;
class circle
{
private:
    struct Node
    {
        Node* ulang;
        int nil;
        Node *lanjutan;
    };
    Node *pertama;
   
public :
   
    circle()
    {
        Node *t1 = new Node();
        t1->ulang = NULL;
        t1->nil = 3;
        t1->lanjutan = NULL;
       pertama = t1;
       
        Node *t2 = new Node();
        t2->ulang = t1;
        t2->nil = 13;
        t2->lanjutan = NULL;
        t1->lanjutan = t2;
       
        Node *t3 = new Node();
        t3->ulang = t2;
        t3->nil = 1;
        t3->lanjutan = NULL;
        t2->lanjutan = t3;
       
        Node *t4 = new Node();
        t4->ulang = t3;
        t4->nil = 33;
        t4->lanjutan = NULL;
        t3->lanjutan = t4;

        Node *t5 = new Node();
        t5->ulang = t4;
        t5->nil = 8;
        t5->lanjutan = NULL;
        t4->lanjutan = t5;

        Node *t6 = new Node();
        t6->ulang = t5;
        t6->nil = 133;
        t6->lanjutan = NULL;
        t5->lanjutan = t6;

        Node *t7 = new Node();
        t7->ulang = t6;
          t7->lanjutan = t1;
        t7->nil = 0;
        t7->lanjutan = NULL;
        t6->lanjutan = t7;
     

    }
   
    ~circle()
    {
        Node *temp =pertama, *current =pertama;
        while(current != NULL)
        {
            temp = current->lanjutan;
            delete current;
            current = temp;
        }
       
    }
   
    void Tampil()
    {
        Node *temp;
        for(temp =pertama; temp != NULL; temp = temp->lanjutan)
        {
            cout<<temp->nil<<" , ";
        }
        cout<<endl;
    }
   
   
    void Sort()
    {
        Node *current, *cur;

        for(current =pertama; current->lanjutan != NULL; current = current->lanjutan)
        {
            Node *minimum = current;
            for(cur = current ; cur != NULL; cur = cur->lanjutan)
            {
                if(minimum->nil > cur->nil)
                {
                    minimum = cur;
                }
            }
            if(minimum != current)
            {
                Node *current_lagi, *current_lanjutan, *min_ulang, *min_lanjutan;

                // Initialize them
                current_lanjutan = current->lanjutan;
                min_ulang = minimum->ulang;
                min_lanjutan = minimum->lanjutan;
                current_lagi = current->ulang;

                if(current_lagi == NULL)
                {
                    // Change thepertama Node
                   pertama = minimum;
                }
                if(current->lanjutan == minimum)
                {
                    // Nodes are Adjacent
                    minimum->ulang = current_lagi;
                    minimum->lanjutan = current;

                    current->ulang= minimum;
                    current->lanjutan = min_lanjutan;

                    if(min_lanjutan)
                    {
                        min_lanjutan->ulang= current;
                    }
                    if(current_lagi)
                    {
                        current_lagi->lanjutan = minimum;
                    }
                }
                else
                {
                    minimum->ulang = current_lagi;
                    minimum->lanjutan = current_lanjutan;

                    current->ulang = min_ulang;
                    current->lanjutan = min_lanjutan;

                    if(current_lanjutan)
                    {
                        current_lanjutan->ulang = minimum;
                    }
                    if(min_ulang)
                    {
                        min_ulang->lanjutan = current;
                    }
                    if(min_lanjutan)
                    {
                        min_lanjutan->ulang = current;
                    }
                    if(current_lagi)
                    {
                        current_lagi->lanjutan = minimum;
                    }
                }
                current = minimum;
            }
        }

    }
};

int main()
{
    circle list;
   
    cout<<"LinkList = ";
   
    list.Tampil();
   
    cout<<"\n\nSort circular likend list \n\n";
   
    list.Sort();
   
    cout<<"LinkList = ";
   
    list.Tampil();
   
    system("PAUSE");
    return EXIT_SUCCESS;
}

Meet 06 pramana rwxr-xr-x 0 4:03 pm

Filename Meet 06
Permission rw-r--r--
Author pramana
Date and Time 4:03 pm
Label
Action
Hi guys...
How are u ?
I hope you are okay :|

On this meet, we learn about circular...
Circular is one of content on structur data..
Circular related to Linklist..
So, circular like as link list but circular kept run to the limit...

I hope u can understand about circular..
Reference about circular

Keep execise guys !!!

Polinomial 2 pramana rwxr-xr-x 0 3:57 pm

Filename Polinomial 2
Permission rw-r--r--
Author pramana
Date and Time 3:57 pm
Label
Action
#include <cstdlib>
#include <iostream>
#include <conio.h>

#define MAX 10
using namespace std;
struct nomi
{
int coeff ;
int exp ;
} ;

struct poly
{
struct nomi t [10] ;
int noofterms ;
} ;


void initpoly ( struct poly * ) ;
void polyappend ( struct poly *, int c, int e ) ;
struct poly polyadd ( struct poly, struct poly ) ;
void display ( struct poly ) ;

int main( )
{
struct poly p1, p2, p3 ;

//clrscr( ) ;

initpoly ( &p1 ) ;
initpoly ( &p2 ) ;
initpoly ( &p3 ) ;

polyappend ( &p1, 1, 7 ) ;
polyappend ( &p1, 2, 6 ) ;
polyappend ( &p1, 3, 5 ) ;
polyappend ( &p1, 4, 4 ) ;
polyappend ( &p1, 5, 2 ) ;

polyappend ( &p2, 1, 4 ) ;
polyappend ( &p2, 1, 3 ) ;
polyappend ( &p2, 1, 2 ) ;
polyappend ( &p2, 1, 1 ) ;
polyappend ( &p2, 2, 0 ) ;

p3 = polyadd ( p1, p2 ) ;

cout<< ( "\nFirst polynomial:\n" ) ;
display(p1) ;

printf ( "\n\nSecond polynomial:\n" ) ;
display ( p2 ) ;

printf ( "\n\nResultant polynomial:\n" ) ;
display ( p3 ) ;

getch( ) ;
}

/* initializes elements of struct poly */
void initpoly ( struct poly *p )
{
int i ;
p -> noofterms = 0 ;
for ( i = 0 ; i < MAX ; i++ )
{
p -> t[i].coeff = 0 ;
p -> t[i].exp = 0 ;
}
}

/* adds the term of polynomial to the array t */
void polyappend ( struct poly *p, int c, int e )
{
p -> t[p -> noofterms].coeff = c ;
p -> t[p -> noofterms].exp = e ;
( p -> noofterms ) ++ ;
}

/* displays the polynomial equation */
void display ( struct poly p )
{
int flag = 0, i ;
for ( i = 0 ; i < p.noofterms ; i++ )
{
if ( p.t[i].exp != 0 )
printf ( "%d x^%d + ", p.t[i].coeff, p.t[i].exp ) ;
else
{
printf ( "%d", p.t[i].coeff ) ;
flag = 1 ;
}
}
if ( !flag )
printf ( "\b\b " ) ;

}

/* adds two polynomials p1 and p2 */
struct poly polyadd ( struct poly p1, struct poly p2 )
{
int i, j, c ;
struct poly p3 ;
initpoly ( &p3 ) ;

if ( p1.noofterms > p2.noofterms )
c = p1.noofterms ;
else
c = p2.noofterms ;

for ( i = 0, j = 0 ; i <= c ; p3.noofterms++ )
{
if ( p1.t[i].coeff == 0 && p2.t[j].coeff == 0 )
break ;
if ( p1.t[i].exp >= p2.t[j].exp )
{
if ( p1.t[i].exp == p2.t[j].exp )
{
p3.t[p3.noofterms].coeff = p1.t[i].coeff + p2.t[j].coeff ;
p3.t[p3.noofterms].exp = p1.t[i].exp ;
i++ ;
j++ ;
}
else
{
p3.t[p3.noofterms].coeff = p1.t[i].coeff ;
p3.t[p3.noofterms].exp = p1.t[i].exp ;
i++ ;
}
}
else
{
p3.t[p3.noofterms].coeff = p2.t[j].coeff ;
p3.t[p3.noofterms].exp = p2.t[j].exp ;
j++ ;
}
}
return p3 ;
}

Meet 05 pramana rwxr-xr-x 0 3:55 pm

Filename Meet 05
Permission rw-r--r--
Author pramana
Date and Time 3:55 pm
Label
Action
Hi guys...

Today, i want share about Structur Data on meet 5th...
On meet 5th, we still learn about polynomial..
We must solve the problem of a case..
Here we must analysis problem to solve...
this like as :

length();
find();
search();
delete();
insert();

for case that, we must understand how to execute the command that,
step by step we try and thanks god we find the solve of problem.

I hope we can hard work to exercise, exercise and exercise..
Keep spirit guys..Wish you all the best :)

Link list pramana rwxr-xr-x 0 8:38 am

Filename Link list
Permission rw-r--r--
Author pramana
Date and Time 8:38 am
Label
Action
#include <iostream>
#include <list>
#include <iterator>
#include <algorithm>
#include <conio.h>
using namespace std;

int main()
{
list<int> intList1, intList2, intList3, intList4;           

    ostream_iterator<int> screen(cout," ");     

    intList1.push_back(23);              
    intList1.push_back(58);           
    intList1.push_back(58);           
    intList1.push_back(58);           
    intList1.push_back(36);             
    intList1.push_back(15);              
    intList1.push_back(93);              
    intList1.push_back(98);              
    intList1.push_back(58);              

    cout<<"Line 12: intList1: ";              
    copy(intList1.begin(),intList1.end(),screen);
    cout<<endl;                      
    intList2 = intList1;                  

    cout<<"Line 16: intList2: ";             
    copy(intList2.begin(),intList2.end(),screen);
    cout<<endl;                      
    intList1.unique();                  



    cout<<"Line 20: After removing the consecutive "
           <<"duplicates,"<<endl
           <<"         intList1: ";              
    copy(intList1.begin(),intList1.end(),screen);
    cout<<endl;                      

    intList2.sort();                  

    cout<<"Line 24: After sorting, intList2: ";  //Line 24
    copy(intList2.begin(),intList2.end(),screen);//Line 25
    cout<<endl;                      
    intList3.push_back(13);              
    intList3.push_back(23);              
    intList3.push_back(25);              
    intList3.push_back(136);              
    intList3.push_back(198);              
   
    cout<<"Line 32: intList3: ";              
    copy(intList3.begin(),intList3.end(),screen);
    cout<<endl;                      

    intList4.push_back(-2);              
    intList4.push_back(-7);              
    intList4.push_back(-8);              
   
    cout<<"Line 38: intList4: ";              
    copy(intList4.begin(),intList4.end(),screen);
    cout<<endl;                      

    intList3.splice(intList3.begin(),intList4); 

    cout<<"Line 42: After moving the elements of "
            <<"intList4 into intList3,"<<endl
            <<"         intList3: ";              
    copy(intList3.begin(),intList3.end(),screen);
    cout<<endl;                      

    intList3.sort();                 

    cout<<"Line 46: After sorting, intList3: "; 
    copy(intList3.begin(),intList3.end(),screen);
    cout<<endl;                      

    intList2.merge(intList3);              

    cout<<"Line 50: After merging intList2 and intList3, "
            <<"intList2: "<<endl<<"         ";      
    copy(intList2.begin(),intList2.end(),screen);
    cout<<endl;                      

    intList2.unique();                  

    cout<<"Line 54: After removing the consecutive "
        <<"duplicates, intList2: "<<endl
       <<"         ";                  
    copy(intList2.begin(),intList2.end(),screen);
    cout<<endl;                      
getch();
    return 0;
}
 

Jayalah Indonesiaku © 2010 Pramana's BLOG
VB (Vio b374k) Template design by p4r46hcyb3rn3t