Toko (C++)

oleh :
arif zainurrohman
 
 
#include<iostream>

using namespace std;

int main(){
int kaos,a,kemeja,b,blouse,c,kaos1,d,total,diskon,total_diskon;
kaos =30000;
kemeja =75000;
blouse =60000;
kaos1 =50000;
cout << "                  Toko " << endl;
cout << "----------------------------------------" << endl;
cout << " Jenis Barang              Harga Barang" << endl;
cout << " 1. Kaos Polos                 @ 30.000    " << endl;
cout << " 2. Kemeja Pria                @ 75.000    " << endl;
cout << " 3. Blouse                     @ 60.000    " << endl;
cout << " 4. Kaos Pendek                @ 50.000    " << endl; 
cout<<"Barang yang dibeli "<<endl;
cout<<"Jumlah Kaos polos : ";cin>>a;
cout<<"Jumlah kemeja pria : ";cin>>b;
cout<<"Jumlah blouse : ";cin>>c;
cout<<"Jumlah Kaos pendek : ";cin>>d;
total=(a*kaos)+(b*kemeja)+(c*blouse)+(d*kaos1);
cout<<"Jumlah pembelian : "<<total<<endl;
if(total>=100000&&total<200000){
    diskon=0.05*total;}
if(total>=200000&&total<500000){
    diskon=0.1*total;}
else{
    diskon=0.2*total;}
cout<<"harga diskon : "<<diskon<<endl;
total_diskon=total-diskon;
cout<<"Bayar : "<<total_diskon<<endl;
}
 
 
 
 
Ibu Kota, 1 Mei 2015

akhukumfillah arifzainurrohman
 

0 komentar:

Posting Komentar