Course Responsive Blogger Template
Paragraph Format
Et posse meliore definitiones (strong) his, vim tritani vulputate (italic) pertinacia at. Augue quaerendum (Acronym) te sea, ex sed sint invenire erroribus. Cu vel ceteros scripserit, te usu modus fabellas mediocritatem. In legere regione instructior eos. Ea repudiandae suscipiantur vim, vel partem labores ponderum in blogger templates link.
Default KBD
To paste copied text content stripped of formatting, use ⌘+Opt+Shift+V.
Code
//Abdul Halim
//BP 1911512015
//Kelas 01
//Prak-72.cpp
#include <iostream>//pada aplikasi Dev.C++ compilenya mendukung format iostream seperti ini
#include <conio.h>
using namespace std;//penambahan untuk header iostream
int pilih; void pilihan();
void insert_data();
void hapus_data();
void cetak_data();
struct node
{
char nama [40];
node *prev, *next;
};
node *baru, *head=NULL, *tail=NULL,*help,*del;
main() //interface monitor
{
do
{
cout<<"Program Memasukkan Nama"<<endl;
cout<<"=========================="<<endl;
cout<<"1. INSERT DATA"<<endl;
cout<<"2. HAPUS DATA"<<endl;
cout<<"3. CETAK DATA"<<endl;
cout<<"Pilihan (1 - 3) : ";
cin>>pilih;
cout<<endl;
pilihan();
cout<<"==============================="<<endl;
}
while(pilih!=4);
}
void pilihan()//fungsi "pilihan" untuk pemrosesan
{
if(pilih==1)
insert_data();
else if(pilih==2)
hapus_data();
else if(pilih==3)
cetak_data();
else
{
cout<<"EXIT";
cout<<"\nSampai Jumpa lagi"<<endl;
}
}
void buat_baru()//fungsi membuat data baru
{
baru = new(node);
cout<<"Masukkan Nama : ";cin>>baru->nama;
cout<<"\n---Data telah dimasukkan---\n";
getch();
baru->prev=NULL;
baru->next=NULL;
}
void insert_data()
{
buat_baru();
if(head==NULL)
{
head=baru;
tail=baru;
}
else
{
baru->next=head;
head->prev=baru;
head=baru;
}
cout<<endl<<endl;
}
void hapus_data()//fungsi penghapusan data
{
int hapus;
char nama[40];
if(head==NULL)
{
cout<<"\nLinked List kosong, \nPenghapusan tidak dapat dilakukan"<<endl;//data yang habis maka tampilannya
}
else
{
hapus=head->nama[40];
cout<<"\nData yang dihapus adalah ";//pemilihan data yang akan dihapus
cin>>nama[40];
del = head;
head = head->next;
delete del;
}
}
void cetak_data()
{
if (head==NULL)
cout<<"\nData tidak dapat ditemukan!"<<endl;//data yang kosong
else
{
help=head;
while(help!=NULL)
{
cout<<"Nama : "<<help->nama;
help=help->next;
}
}
getch();
}
Paragraph As Blockquote
Eu mei solum oporteat eleifend, libris nominavi maiestatis duo at, quod dissentiet vel te. Legere prompta impedit id eum. Te soleat vocibus luptatum sed, augue dicta populo est ad, et consul diceret officiis duo. Et duo primis nostrum.
Paragraph As Blockquote
Belajarlah dari pengalaman
Unordered list
- Blogger templates
- Templates
- Blogs
- Layouts
- Skins
Ordered list
- Login
- Visit Idntheme
- Download template
- Install
- Enjoy!
Youtube Video
Heading
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Button
Download File
Demo Info Contact Me
Table
Table Header 1 | Table Header 2 | Table Header 3 |
---|---|---|
Division 1 | Division 2 | Division 3 |
Division 1 | Division 2 | Division 3 |
Division 1 | Division 2 | Division 3 |