#include<iostream>
#include<conio.h>
#include <stdlib.h>
using namespace std;
int main(){
double jml1, jml2, harga1, harga2, total1, total2, hitungppn;
char flg_status;
repeat:
cout<<"* TOSERBA - TOKO SERBA ADA *";
cout<<"\n"; cout<<"\n";
cout<<" ID CUST : C05023";
cout<<"\n";
cout<<" BARANG YANG DIBELI : ";
cout<<"\n";
cout<<" 1. NAMA BARANG : " ; cout<<"MIE INSTAN";
cout<<"\n";
cout<<" HARGA : "; cout<<"Rp.48.500 PerKardus";
cout<<"\n";
cout<<" DISC : " ; cout<<"10%";
cout<<"\n";
cout<<" JUMLAH : "; cin>>jml1;
harga1 = 48500;
cout<<"\n";
cout<<" 2. NAMA BARANG : " ; cout<<"MINYAK GORENG";
cout<<"\n";
cout<<" HARGA : "; cout<<"Rp.22.000 PerLiter";
cout<<"\n";
cout<<" DISC : " ; cout<<"-";
cout<<"\n";
cout<<" JUMLAH : "; cin>>jml2;
harga2 = 22000;
cout<<"\n"; cout<<"\n";
/* Hitung */
cout<<"===========================================";
cout<<"\n"; cout<<"\n";
cout<<" PROSES PERHITUNGAN :" ;
cout<<"\n"; cout<<"\n";
total1 = harga1 * jml1;
total2 = harga2 * jml2;
hitungppn = 0.1*total1+total2;
cout<<" PPN : "<<hitungppn;
cout<<"\n";
cout<<" TOTAL PEMBELIAN : "<<total1+total2-hitungppn;
cout<<"\n"; cout<<"\n";
cout<<"===========================================";
cout<<"\n";
cout<<" Kembali ke menu awal [y] : "; cin>>flg_status;
if(flg_status == 'y' || flg_status == 'Y'){
system("cls");
goto repeat;
}
getche();
return 0;
}
HASIL SCHREENSHOT :
Tidak ada komentar:
Posting Komentar