Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include "SLL.cpp"
- void SearchDataProduk(List L){
- string input;
- cout << "Masukan nama produk yang dicari : ";
- cin >> input;
- address check = findInfo(L,input);
- if(check != NULL){
- cout << "PRODUK DITEMUKAN PADA ALAMAT "<< check << endl;
- }else{
- cout << "MAAF PRODUK TIDAK DITEMUKAN";
- }
- }
- int main(){
- List data;
- createList(data);
- string input;
- for(int x = 0;x<5;x++){
- cout << "Masukan nama produk ke-" << x+1 << " : ";
- cin >> input;
- address adds = alokasi(input);
- insertLast(data,adds);
- }
- cout << "Daftar produk saat ini adalah : ";
- Show(data);
- cout<<endl;
- SearchDataProduk(data);
- cout<<endl;
- SearchDataProduk(data);
- cout<<endl;
- cout << "Daftar Awal produk : ";
- Show(data);
- while(first(data) != NULL){
- cout << "Lokasi produk yang dihapus (depan/belakang) ? ";
- cin >> input;
- address deleted;
- if(input == "depan"){
- deleteFirst(data,deleted);
- }else if(input == "belakang"){
- deleteLast(data,deleted);
- }
- if(deleted != NULL){
- cout << "Data yang dihapus : " << info(deleted) << endl;
- cout << "Daftar setelah dihapus : ";
- Show(data);
- }
- cout << endl;
- }
- cout << "SELESAI" << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement