Berikut adalah sintaksnya dan bisa juga didownload disini:
#include <stdio.h>
#include <iostream.h>
#include <conio.h>
main()
{
char kd;
char ukr, merk[20];
long int hrg,byr,ppn,ttl,ubay,ukem,byk;
cout<<"create by abe_here";
clrscr();
cout<<"***Toko Susu Susi***"<<endl;
cout<<"===================="<<endl;
cout<<"A. Susu Dancow"<<endl;
cout<<" 1. Ukuran Kecil"<<endl;
cout<<" 2. Ukuran Sedang"<<endl;
cout<<" 3. Ukuran Besar"<<endl;
cout<<"B. Susu Bendera"<<endl;
cout<<" 1. Ukuran Kecil"<<endl;
cout<<" 2. Ukuran Sedang"<<endl;
cout<<" 3. Ukuran Besar"<<endl;
cout<<"C. Susu SGM"<<endl;
cout<<" 1. Ukuran Kecil"<<endl;
cout<<" 2. Ukuran Sedang"<<endl;
cout<<" 3. Ukuran Besar"<<endl;
cout<<"\nMasukan Jenis Susu [A/B/C] : ";cin>>kd;
cout<<"\nMasukan Ukuran Kaleng [1/2/3] : ";cin>>ukr;
cout<<"\nBanyak Beli : ";cin>>byk;
if(kd=='A'||kd=='a')
{strcpy(merk,"Dancow");
if(ukr=='1')hrg=15000;
else if(ukr=='2')hrg=26000;
else hrg=45000;}
else if(kd=='B'||kd=='b')
{strcpy(merk,"Bendera");
if(ukr=='1')hrg=12000;
else if(ukr=='2')hrg=22000;
else hrg=40000;}
else
{strcpy(merk,"SGM");
if(ukr=='1')hrg=20000;
else if(ukr=='2')hrg=38000;
else hrg=70000;}
cout<<"Merk Susu : "<<merk<<endl;
cout<<"Harga Susu : "<<hrg<<endl;
byr=hrg*byk;
cout<<"Pembayaran : "<<byr<<endl;
ppn=0.1*byr;
ttl=byr+ppn;
cout<<"PPN : "<<ppn<<endl;
cout<<"Total Bayar : "<<ttl<<endl;
cout<<"Uang Bayar : ";cin>>ubay;
ukem=ubay-ttl;
cout<<"Uang Kembali : "<<ukem<<endl;
cout<<"\nTerima Kasih Sudah Berbelanja Ditempat Kami"<<endl;
getch();
}
No comments:
Post a Comment