SlideShare a Scribd company logo
1 of 11
Nama anggota:
M. Sabillal Alif 2014-31-201
Bowval Valentino 2014-31-202
Tri Maulidza 2014-31-203
Michael Suharto Sihite 2014-31-236

Program




Penjelasan Program
void push1()
{
for(i=0;i<=17; i++)
{
gotoxy(22+i,7);cout<<" ";
gotoxy(23+i,7); cout<<tmp; speed();
}
for(i=1;i<=(14-tdc);i++)
{
speed();
gotoxy(40,6+i); cout<<" ";
gotoxy(40,7+i); cout<<tmp;
}
}
void push(char e)
{
tdc=tdc+1;
stack[tdc]=e;
push1();
}
Sub program ini
digunakan untuk
memasukkan data
yang diinginkan
void pop1(char temp)
{
for(i=1;i<=(14-tdc);i++)
{
speed();
gotoxy(40,22-i-tdc); cout<<" ";
gotoxy(40,21-i-tdc); cout<<tmp;
}
for(i=1;i<=19;i++)
{
speed();
gotoxy(38+i,7); cout<<" ";
gotoxy(39+i,7); cout<<tmp; speed();
}
gotoxy(58,7);cout<<" ";
}
void pop(char e)
{
if(tdc !=0)
{
gotoxy(1,7); cout<<" "<<endl;
e=stack[tdc]; pop1(e);
tdc=tdc-1;
}
else
{
gotoxy(1,7); cout<<"stack kosong!"<<endl;
gotoxy(1,7);
}
}
Sub program ini
untuk
mengeluarkan data
setelah di push atau
di masukkan
Ini adalah program inti dimana sub program tadi
dipanggil dan diproses oleh program inti
void main()
{
clrscr();
cout<<"program stack dengan animasi"<<endl;
cout<<"1.push--> memasukkan data"<<endl;
cout<<"2.pop---> mengambil data"<<endl;
cout<<"3.clear-> membersihkan data"<<endl;
cout<<"4.exit--> keluar"<<endl;
//cout<<"pilih [1/2/3/4] ="<<endl;
clear:
gotoxy(59,6); cout<<"-";
gotoxy(59,9); cout<<"_";
gotoxy(37,10); cout<<"|| ||";
for(i=1;i<=11;i++)
{
gotoxy(38,10+i);
if(i==11)
cout<<"|___|";
else
cout<<"| |";
}
tdc=0;
do
{
getch();
}
input:
gotoxy(1,6);
cout<<"masukkan pilihan anda[1/2/3/4] : ";
answer=getche();
if(int(answer)==27 || answer=='4')
break;
else if(answer=='1')
{
if(tdc != 7)
{
gotoxy(1,7); cout<<"masukkan suatu huruf : ";
cin>>tmp;
push(tmp);
gotoxy(1,7); cout<<" ";
}
else
{
gotoxy(1,7); cout<<"stack penuh!";
getch();
gotoxy(1,7); cout<<" ";
}
}
else if(answer=='2')
pop(tmp);
else if(answer=='3')
goto clear;
else
goto input;
}
while(1);
getch();
}
Output Program
Jika memilih pilihan 1 (satu) maka kita akan memasukkan data, disini kami
memakai data “A” maka data “A” akan masuk kedalam antrian
Jika memilih pilihan 2 (dua) maka data yang dimasukkan sebelumnya akan
diambil, data “A” yang tadi dimasukkan dihapus atau diambil dari antrian
Dan
Pilihan 3 (tiga) untuk menghapus atau membersihkan semua data yang ada
diantrian

More Related Content

Recently uploaded

HAK DAN KEWAJIBAN WARGA NEGARA ppkn i.ppt
HAK DAN KEWAJIBAN WARGA NEGARA ppkn i.pptHAK DAN KEWAJIBAN WARGA NEGARA ppkn i.ppt
HAK DAN KEWAJIBAN WARGA NEGARA ppkn i.ppt
nabilafarahdiba95
 
PPT SOSIALISASI PENGELOLAAN KINERJA GURU DAN KS 2024.pptx
PPT SOSIALISASI PENGELOLAAN KINERJA GURU DAN KS 2024.pptxPPT SOSIALISASI PENGELOLAAN KINERJA GURU DAN KS 2024.pptx
PPT SOSIALISASI PENGELOLAAN KINERJA GURU DAN KS 2024.pptx
MaskuratulMunawaroh
 
Kisi kisi Ujian sekolah mata pelajaran IPA 2024.docx
Kisi kisi Ujian sekolah mata pelajaran IPA 2024.docxKisi kisi Ujian sekolah mata pelajaran IPA 2024.docx
Kisi kisi Ujian sekolah mata pelajaran IPA 2024.docx
FitriaSarmida1
 
Kenakalan Remaja (Penggunaan Narkoba).ppt
Kenakalan Remaja (Penggunaan Narkoba).pptKenakalan Remaja (Penggunaan Narkoba).ppt
Kenakalan Remaja (Penggunaan Narkoba).ppt
novibernadina
 
BAB 5 KERJASAMA DALAM BERBAGAI BIDANG KEHIDUPAN.pptx
BAB 5 KERJASAMA DALAM BERBAGAI BIDANG KEHIDUPAN.pptxBAB 5 KERJASAMA DALAM BERBAGAI BIDANG KEHIDUPAN.pptx
BAB 5 KERJASAMA DALAM BERBAGAI BIDANG KEHIDUPAN.pptx
JuliBriana2
 
Aksi Nyata Sosialisasi Profil Pelajar Pancasila.pdf
Aksi Nyata Sosialisasi Profil Pelajar Pancasila.pdfAksi Nyata Sosialisasi Profil Pelajar Pancasila.pdf
Aksi Nyata Sosialisasi Profil Pelajar Pancasila.pdf
JarzaniIsmail
 

Recently uploaded (20)

MODUL AJAR SENI RUPA KELAS 6 KURIKULUM MERDEKA.pdf
MODUL AJAR SENI RUPA KELAS 6 KURIKULUM MERDEKA.pdfMODUL AJAR SENI RUPA KELAS 6 KURIKULUM MERDEKA.pdf
MODUL AJAR SENI RUPA KELAS 6 KURIKULUM MERDEKA.pdf
 
PELAKSANAAN + Link2 Materi BimTek _PTK 007 Rev-5 Thn 2023 (PENGADAAN) & Perhi...
PELAKSANAAN + Link2 Materi BimTek _PTK 007 Rev-5 Thn 2023 (PENGADAAN) & Perhi...PELAKSANAAN + Link2 Materi BimTek _PTK 007 Rev-5 Thn 2023 (PENGADAAN) & Perhi...
PELAKSANAAN + Link2 Materi BimTek _PTK 007 Rev-5 Thn 2023 (PENGADAAN) & Perhi...
 
Prakarsa Perubahan dan kanvas ATAP (1).pptx
Prakarsa Perubahan dan kanvas ATAP (1).pptxPrakarsa Perubahan dan kanvas ATAP (1).pptx
Prakarsa Perubahan dan kanvas ATAP (1).pptx
 
HAK DAN KEWAJIBAN WARGA NEGARA ppkn i.ppt
HAK DAN KEWAJIBAN WARGA NEGARA ppkn i.pptHAK DAN KEWAJIBAN WARGA NEGARA ppkn i.ppt
HAK DAN KEWAJIBAN WARGA NEGARA ppkn i.ppt
 
Bab 4 Persatuan dan Kesatuan di Lingkup Wilayah Kabupaten dan Kota.pptx
Bab 4 Persatuan dan Kesatuan di Lingkup Wilayah Kabupaten dan Kota.pptxBab 4 Persatuan dan Kesatuan di Lingkup Wilayah Kabupaten dan Kota.pptx
Bab 4 Persatuan dan Kesatuan di Lingkup Wilayah Kabupaten dan Kota.pptx
 
PPT SOSIALISASI PENGELOLAAN KINERJA GURU DAN KS 2024.pptx
PPT SOSIALISASI PENGELOLAAN KINERJA GURU DAN KS 2024.pptxPPT SOSIALISASI PENGELOLAAN KINERJA GURU DAN KS 2024.pptx
PPT SOSIALISASI PENGELOLAAN KINERJA GURU DAN KS 2024.pptx
 
SOAL PUBLIC SPEAKING UNTUK PEMULA PG & ESSAY
SOAL PUBLIC SPEAKING UNTUK PEMULA PG & ESSAYSOAL PUBLIC SPEAKING UNTUK PEMULA PG & ESSAY
SOAL PUBLIC SPEAKING UNTUK PEMULA PG & ESSAY
 
OPTIMALISASI KOMUNITAS BELAJAR DI SEKOLAH.pptx
OPTIMALISASI KOMUNITAS BELAJAR DI SEKOLAH.pptxOPTIMALISASI KOMUNITAS BELAJAR DI SEKOLAH.pptx
OPTIMALISASI KOMUNITAS BELAJAR DI SEKOLAH.pptx
 
Kisi kisi Ujian sekolah mata pelajaran IPA 2024.docx
Kisi kisi Ujian sekolah mata pelajaran IPA 2024.docxKisi kisi Ujian sekolah mata pelajaran IPA 2024.docx
Kisi kisi Ujian sekolah mata pelajaran IPA 2024.docx
 
Kenakalan Remaja (Penggunaan Narkoba).ppt
Kenakalan Remaja (Penggunaan Narkoba).pptKenakalan Remaja (Penggunaan Narkoba).ppt
Kenakalan Remaja (Penggunaan Narkoba).ppt
 
vIDEO kelayakan berita untuk mahasiswa.ppsx
vIDEO kelayakan berita untuk mahasiswa.ppsxvIDEO kelayakan berita untuk mahasiswa.ppsx
vIDEO kelayakan berita untuk mahasiswa.ppsx
 
PPT MODUL 6 DAN 7 PDGK4105 KELOMPOK.pptx
PPT MODUL 6 DAN 7 PDGK4105 KELOMPOK.pptxPPT MODUL 6 DAN 7 PDGK4105 KELOMPOK.pptx
PPT MODUL 6 DAN 7 PDGK4105 KELOMPOK.pptx
 
MODUL AJAR BAHASA INDONESIA KELAS 5 KURIKULUM MERDEKA.pdf
MODUL AJAR BAHASA INDONESIA KELAS 5 KURIKULUM MERDEKA.pdfMODUL AJAR BAHASA INDONESIA KELAS 5 KURIKULUM MERDEKA.pdf
MODUL AJAR BAHASA INDONESIA KELAS 5 KURIKULUM MERDEKA.pdf
 
Pengenalan Figma, Figma Indtroduction, Figma
Pengenalan Figma, Figma Indtroduction, FigmaPengenalan Figma, Figma Indtroduction, Figma
Pengenalan Figma, Figma Indtroduction, Figma
 
BAB 5 KERJASAMA DALAM BERBAGAI BIDANG KEHIDUPAN.pptx
BAB 5 KERJASAMA DALAM BERBAGAI BIDANG KEHIDUPAN.pptxBAB 5 KERJASAMA DALAM BERBAGAI BIDANG KEHIDUPAN.pptx
BAB 5 KERJASAMA DALAM BERBAGAI BIDANG KEHIDUPAN.pptx
 
Aksi Nyata Sosialisasi Profil Pelajar Pancasila.pdf
Aksi Nyata Sosialisasi Profil Pelajar Pancasila.pdfAksi Nyata Sosialisasi Profil Pelajar Pancasila.pdf
Aksi Nyata Sosialisasi Profil Pelajar Pancasila.pdf
 
MODUL AJAR MATEMATIKA KELAS 3 KURIKULUM MERDEKA.pdf
MODUL AJAR MATEMATIKA KELAS 3 KURIKULUM MERDEKA.pdfMODUL AJAR MATEMATIKA KELAS 3 KURIKULUM MERDEKA.pdf
MODUL AJAR MATEMATIKA KELAS 3 KURIKULUM MERDEKA.pdf
 
Memperkasakan Dialog Prestasi Sekolah.pptx
Memperkasakan Dialog Prestasi Sekolah.pptxMemperkasakan Dialog Prestasi Sekolah.pptx
Memperkasakan Dialog Prestasi Sekolah.pptx
 
Program Kerja Public Relations - Perencanaan
Program Kerja Public Relations - PerencanaanProgram Kerja Public Relations - Perencanaan
Program Kerja Public Relations - Perencanaan
 
AKSI NYATA TOPIK 1 MERDEKA BELAJAR. PPTX
AKSI NYATA TOPIK 1 MERDEKA BELAJAR. PPTXAKSI NYATA TOPIK 1 MERDEKA BELAJAR. PPTX
AKSI NYATA TOPIK 1 MERDEKA BELAJAR. PPTX
 

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Kelompok struktur data

  • 1. Nama anggota: M. Sabillal Alif 2014-31-201 Bowval Valentino 2014-31-202 Tri Maulidza 2014-31-203 Michael Suharto Sihite 2014-31-236
  • 3.
  • 4.
  • 5.
  • 6.  Penjelasan Program void push1() { for(i=0;i<=17; i++) { gotoxy(22+i,7);cout<<" "; gotoxy(23+i,7); cout<<tmp; speed(); } for(i=1;i<=(14-tdc);i++) { speed(); gotoxy(40,6+i); cout<<" "; gotoxy(40,7+i); cout<<tmp; } } void push(char e) { tdc=tdc+1; stack[tdc]=e; push1(); } Sub program ini digunakan untuk memasukkan data yang diinginkan
  • 7. void pop1(char temp) { for(i=1;i<=(14-tdc);i++) { speed(); gotoxy(40,22-i-tdc); cout<<" "; gotoxy(40,21-i-tdc); cout<<tmp; } for(i=1;i<=19;i++) { speed(); gotoxy(38+i,7); cout<<" "; gotoxy(39+i,7); cout<<tmp; speed(); } gotoxy(58,7);cout<<" "; } void pop(char e) { if(tdc !=0) { gotoxy(1,7); cout<<" "<<endl; e=stack[tdc]; pop1(e); tdc=tdc-1; } else { gotoxy(1,7); cout<<"stack kosong!"<<endl; gotoxy(1,7); } } Sub program ini untuk mengeluarkan data setelah di push atau di masukkan
  • 8. Ini adalah program inti dimana sub program tadi dipanggil dan diproses oleh program inti void main() { clrscr(); cout<<"program stack dengan animasi"<<endl; cout<<"1.push--> memasukkan data"<<endl; cout<<"2.pop---> mengambil data"<<endl; cout<<"3.clear-> membersihkan data"<<endl; cout<<"4.exit--> keluar"<<endl; //cout<<"pilih [1/2/3/4] ="<<endl; clear: gotoxy(59,6); cout<<"-"; gotoxy(59,9); cout<<"_"; gotoxy(37,10); cout<<"|| ||"; for(i=1;i<=11;i++) { gotoxy(38,10+i); if(i==11) cout<<"|___|"; else cout<<"| |"; } tdc=0; do { getch(); } input: gotoxy(1,6); cout<<"masukkan pilihan anda[1/2/3/4] : "; answer=getche(); if(int(answer)==27 || answer=='4') break; else if(answer=='1') { if(tdc != 7) { gotoxy(1,7); cout<<"masukkan suatu huruf : "; cin>>tmp; push(tmp); gotoxy(1,7); cout<<" "; } else { gotoxy(1,7); cout<<"stack penuh!"; getch(); gotoxy(1,7); cout<<" "; } } else if(answer=='2') pop(tmp); else if(answer=='3') goto clear; else goto input; } while(1); getch(); }
  • 10. Jika memilih pilihan 1 (satu) maka kita akan memasukkan data, disini kami memakai data “A” maka data “A” akan masuk kedalam antrian
  • 11. Jika memilih pilihan 2 (dua) maka data yang dimasukkan sebelumnya akan diambil, data “A” yang tadi dimasukkan dihapus atau diambil dari antrian Dan Pilihan 3 (tiga) untuk menghapus atau membersihkan semua data yang ada diantrian