1.Buka borland c++
usahakan jangan copy paste teman-teman biar pinter.. :)
#include <conio.h>
#include <stdio.h>
#include <iostream.h>
int main() {
struct
{
char kobar, nabar[20];
int harga,jumlh,total,bayar,kembali;
}brng;
char awal, ulang;
awal:
clrscr();
puts("==============================================");
puts(" *ANGKRINGAN DODIT PRIAMBODO* ");
puts("==============================================");
puts("[1] input Makanan");
puts("[2] input Barang");
puts("[3] input Minuman");
puts("[4] exit");
cout<<"Pilih kode menu [1/2/3/4] : ";cin>>awal;
if (awal=='1')
goto satu;
else
if (awal=='2')
goto dua;
else if (awal=='3')
goto tiga;
else
goto empat;
satu:
clrscr();
puts("================================================");
puts(" >DAFTAR MENU ANKRINGAN BOS DODIT< ");
puts(" Jln. S.parman no: 23 (belakang asli motor)");
puts(" kasir : Rudy pakyu hp:085747788024 ");
puts("================================================");
puts("[A] Nasi Kucing");
puts("[B] Mendoan anget");
puts("[C] Kopi ABC susu");
puts("[D] udut jarum 12");
puts("[E] Jahe susu");
puts("[F] usus ayam");
puts("[G] Ndas ayam");
puts("[H] kopi hitam");
puts("[J] kopi putih");
puts("[K] es teh");
puts("[L] Rempela ayam");
puts("[M] ceker");
puts("[N] es jeruk");
puts("[M] nasi sambel");
puts("[0] tempe goreng");
puts("[P] paha");
puts("[Q] peyek");
puts("[R] gesek");
puts("[S] udut bintang samudra");
puts("[T] djisamsu");
puts("[U] udut dunhill");
puts("[V] kepala ayam");
puts("[W] air tawar");
puts("[X] brutu ayam pedas");
puts("[Z] bakwan");
cout<<"Kode barang [A/B/C/D] :"; cin>>brng.kobar;
if (brng.kobar=='A'||brng.kobar=='a')
{strcpy (brng.nabar, "Nasi Kucing");
brng.harga=2000;}
else
if (brng.kobar=='B'||brng.kobar=='b')
{strcpy (brng.nabar, "Mendoan anget");
brng.harga=500;}
else
if (brng.kobar=='C'||brng.kobar=='c')
{strcpy (brng.nabar, "Kopi ABC susu");
brng.harga=2500;}
else
if (brng.kobar=='D'||brng.kobar=='d')
{strcpy (brng.nabar, "Udut jarum 12");
brng.harga=1000;}
else
if (brng.kobar=='E'||brng.kobar=='e')
{strcpy (brng.nabar, "Jahe susu");
brng.harga=1000;}
else
if (brng.kobar=='F'||brng.kobar=='f')
{strcpy (brng.nabar, "udut sampoerna mild");
brng.harga=1000;}
else
if (brng.kobar=='G'||brng.kobar=='h')
{strcpy (brng.nabar, "udut sampoerna mild");
brng.harga=1000;}
else
if (brng.kobar=='I'||brng.kobar=='j')
{strcpy (brng.nabar, "udut sampoerna mild");
brng.harga=1000;}
else
if (brng.kobar=='J'||brng.kobar=='j')
{strcpy (brng.nabar, "udut sampoerna mild");
brng.harga=1000;}
else
if (brng.kobar=='K'||brng.kobar=='k')
{strcpy (brng.nabar, "udut sampoerna mild");
brng.harga=1000;}
else
if (brng.kobar=='L'||brng.kobar=='m')
{strcpy (brng.nabar, "udut sampoerna mild");
brng.harga=1000;}
else
if (brng.kobar=='N'||brng.kobar=='n')
{strcpy (brng.nabar, "udut sampoerna mild");
brng.harga=1000;}
else
if (brng.kobar=='M'||brng.kobar=='n')
{strcpy (brng.nabar, "udut sampoerna mild");
brng.harga=1000;}
else
if (brng.kobar=='O'||brng.kobar=='o')
{strcpy (brng.nabar, "udut sampoerna mild");
brng.harga=1000;}
else
if (brng.kobar=='P'||brng.kobar=='p')
{strcpy (brng.nabar, "udut sampoerna mild");
brng.harga=1000;}
else
{strcpy (brng.nabar, "");
brng.harga=5000;}
puts("================================================");
cout<<"Nama Barang : "<<brng.nabar<<endl;
cout<<"Harga Barang : Rp. "<<brng.harga<<endl;
cout<<"Jumlah Beli : ";cin>>brng.jumlh;
brng.total=brng.harga*brng.jumlh;
cout<<"Total bayar : Rp. "<<brng.total<<endl;
cout<<"Jumlah Uang Bayar : Rp. ";cin>>brng.bayar;
brng.kembali=brng.bayar-brng.total;
cout<<"Uang kembali : Rp. "<<brng.kembali<<endl;
puts("===============================================");
cout<<"Mau input lagi [Y/T] : ";cin>>ulang;
if(ulang=='Y'||ulang=='y')
goto satu;
else
goto awal;
dua:
clrscr();
puts("=============================================");
puts("* DAFTAR BARANG ");
puts("=============================================");
puts("[A] Bata");
puts("[B] Nevada");
puts("[C] Homyped");
puts("[D] Machbeth");
cout<<"Kode barang [A/B/C/D] : "; cin>>brng.kobar;
if (brng.kobar=='A'||brng.kobar=='a')
{strcpy (brng.nabar, "Bata");
brng.harga=100000;}
else
if (brng.kobar=='B'||brng.kobar=='b')
{strcpy (brng.nabar, "Nevada");
brng.harga=100000;}
else
if (brng.kobar=='C'||brng.kobar=='c')
{strcpy (brng.nabar, "hompyed");
brng.harga=150000;}
else
{strcpy (brng.nabar, "machbeth");
brng.harga=800000;}
puts("===============================================");
cout<<"Nama Barang : "<<brng.nabar<<endl;
cout<<"Harga barang : Rp. "<<brng.harga<<endl;
cout<<"Jumlah Beli : ";cin>>brng.jumlh;
brng.total=brng.harga*brng.jumlh;
cout<<"Total bayar : Rp. "<<brng.total<<endl;
cout<<"Uang bayar : Rp. ";cin>>brng.bayar;
brng.kembali=brng.bayar-brng.total;
cout<<"Uang kembali : Rp. "<<brng.kembali<<endl;
puts("=============================================");
cout<<"Transaksi lagi [Y/T] : ";cin>>ulang;
if (ulang=='Y'||ulang=='y')
goto dua;
else
goto awal;
tiga:
clrscr();
puts("===============================================");
puts("* DAFTAR MINUMAN *");
puts("===============================================");
puts("[A] Fanta");
puts("[B] Es jeruk");
puts("[C] Es Teh");
puts("[D] Puply orange");
cout<<"Kode barang[A/B/C/D] : ";cin>>brng.kobar;
if (brng.kobar=='A'||brng.kobar=='a')
{strcpy (brng.nabar, "Fanta");
brng.harga=4000;}
else
if (brng.kobar=='B'||brng.kobar=='b')
{strcpy (brng.nabar, "Es jeruk");
brng.harga=6000;}
else
if (brng.kobar=='C'||brng.kobar=='c')
{strcpy (brng.nabar, "Es teh");
brng.harga=3000;}
else
{strcpy(brng.nabar,"Puply orange");
brng.harga=8000;}
puts("===================================================");
cout<<"Nama barang : "<<brng.nabar<<endl;
cout<<"Harga barang :Rp. "<<brng.harga<<endl;
cout<<"Jumlah beli : ";cin>>brng.jumlh;
brng.total=brng.harga*brng.jumlh;
cout<<"Total Bayar :Rp. "<<brng.total<<endl;
cout<<"Uang Bayar :Rp. ";cin>>brng.bayar;
brng.kembali=brng.bayar-brng.total;
cout<<"Uang kembali : Rp. "<<brng.kembali<<endl;
puts("===================================================");
cout<<"Mau input lagy [Y/T] :";cin>>ulang;
if (ulang=='Y'||ulang=='y')
goto tiga;
else
goto awal;
empat:
cout<<endl;
cout<<"****TERIMA KASIH****";
getch();
return 0;
}
2.Maka akan tampil
tampilan kedua
terimakasih semoga bermanfaat :)
Tidak ada komentar:
Posting Komentar