#include<iostream>
#include<string>
#include<conio.h>
using namespace std;
void main ()
{
cout<<endl;
cout<<"***** program hitung kantin mini Market *****"<<endl;
string databrg,nama,kode,ket;
int jumlah, harga,total,diskon,bayar,total1;
cout<<" Kode barang : "; getline(cin,kode);
cout<<" Nama barang : "<<nama;
if( nama==kode || kode=="AB")
{
cout<<"BUKU"<<endl;
harga=75000;
}
else if (nama==kode || kode=="PN")
{
cout<<" Pena "<<endl;
harga=20000;
}
else if (nama==kode || kode=="PG")
{
cout<<" PENGGARIS "<<endl;
harga=10000;
}
cout<<" Jumlah : "; cin>>jumlah;
cout<<" Harga : Rp. "<<harga<<endl;
cout<<"========================================================="<<endl;
total= harga * jumlah;
cout<<" Grand total : Rp. "<<total<<endl;
if (total>200000)
{
diskon=total*10/100;
}
else if (total<200000)
{
diskon=0;
}
cout<<" Discount : Rp. "<<diskon<<endl;
cout<<"__________________________________________________________ -"<<endl;
total1=total-diskon;
cout<<" total setelah diskon : Rp. "<<total1<<endl;
cout<<" Uang pembayaran : Rp. ";cin>>bayar;
cout<<" Kembalian : Rp. "<<(bayar-total1)<<endl<<endl<<endl<<endl;
cout<<" *********** Terima Kasih Atas Kunjungannya *********** " <<endl;
getche();
}
#include<string>
#include<conio.h>
using namespace std;
void main ()
{
cout<<endl;
cout<<"***** program hitung kantin mini Market *****"<<endl;
string databrg,nama,kode,ket;
int jumlah, harga,total,diskon,bayar,total1;
cout<<" Kode barang : "; getline(cin,kode);
cout<<" Nama barang : "<<nama;
if( nama==kode || kode=="AB")
{
cout<<"BUKU"<<endl;
harga=75000;
}
else if (nama==kode || kode=="PN")
{
cout<<" Pena "<<endl;
harga=20000;
}
else if (nama==kode || kode=="PG")
{
cout<<" PENGGARIS "<<endl;
harga=10000;
}
cout<<" Jumlah : "; cin>>jumlah;
cout<<" Harga : Rp. "<<harga<<endl;
cout<<"========================================================="<<endl;
total= harga * jumlah;
cout<<" Grand total : Rp. "<<total<<endl;
if (total>200000)
{
diskon=total*10/100;
}
else if (total<200000)
{
diskon=0;
}
cout<<" Discount : Rp. "<<diskon<<endl;
cout<<"__________________________________________________________ -"<<endl;
total1=total-diskon;
cout<<" total setelah diskon : Rp. "<<total1<<endl;
cout<<" Uang pembayaran : Rp. ";cin>>bayar;
cout<<" Kembalian : Rp. "<<(bayar-total1)<<endl<<endl<<endl<<endl;
cout<<" *********** Terima Kasih Atas Kunjungannya *********** " <<endl;
getche();
}