Kamis, 01 November 2012

Contoh Program Penjualan KUE *Soal Quiz Algoritma & Pemrograman 1

Assalamualaikum
allhamdulillah bisa sahare ilmu lagi neh, kali ini ane mau bagiin script dari hasil quiz dari mata kuliah Algoritma & Pemrograman 1
berikut ini  script nya :

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

main()
{
char nama[30],kode[2],*kue,awal,proses;
int jmlh,harga,tot;

awal:
clrscr();
cout<<"II. Rancangan Masukkan\nDAFTAR MENU TOKO NIKMAT\n";
cout<<" 1. BOLU BLACK FOREST (BB)\n 2. CHESSE CAKE (CC)\n 3. BANANA CAKE (BC)\n 4. STRAWBERI CAKE (SC)\n\n";

cout<<"NAMA PEMBELI = ";cin>>nama;
cout<<"==================================================\n";
cout<<"KODE KUE = ";cin>>kode;
cout<<"JUMLAH KUE = ";cin>>jmlh;

clrscr();
cout<<"III. RANCANGAN KELUARAN\n\nTOKO KUE NIKMAT\nSTRUK PEMBAYARAN\n***************************\n";
cout<<"NAMA PEMBELI = "<<nama<<endl;
cout<<"KODE KUE = "<<kode<<endl;
{ if ((!strcmp(kode,"BB"))||(!strcmp (kode,"bb")))
{kue="BOLU BLACK FOREST";
harga=60000;}

else if ((!strcmp(kode,"CC"))||(!strcmp (kode,"cc")))
{kue="CHESSE CAKE";
harga=45000; }

else if ((!strcmp(kode,"BC"))||(!strcmp (kode,"bc")))
{ kue="BANANA CAKE";
harga=25500; }

else if ((!strcmp(kode,"SC"))||(!strcmp (kode,"SC")))
{ kue="STRAWBERI CAKE";
harga=35000; }
}
cout<<"NAMA KUE = "<<kue<<endl;
cout<<"HARGA KUE = Rp "<<harga<<endl;
cout<<"JUMLAH KUE = "<<jmlh<<endl;
cout<<"----------------------------------------\n";
tot=harga*jmlh;
cout<<"JUMLAH BAYAR = Rp "<<tot<<endl;
cout<<"\n\n\n TERIMA KASIH ATAS KUNJUNGANNYA\n\n";
cout<<"Apakah akan kembali proses (y/n)= ";cin>>proses;
if (proses=='Y'||proses=='y')
goto awal;
else
cout<<"Good Bye";
getch();
}

Screen Shoot :




Selamat Berkarya :D
Semoga Bermanfaat, GOOD LUCK :D

Tidak ada komentar:

Poskan Komentar

terimakasih telah berkunjung dan berkomentar :D