Contoh Program >>>
#include<stdio.h>
#include<conio.h>
#include<iostream>
using namespace std;
main()
{
double tot_beli, potongan = 0, jumlah_bayar = 0;
cout<<"total pembelian Rp. ";cin>>tot_beli;
if(tot_beli >= 50000)
potongan = 0.2*tot_beli;
else
potongan = 0.05*tot_beli;
cout<<"besaran potongan Rp."<<potongan<<endl;
jumlah_bayar = tot_beli - potongan;
cout<<"jumlah yang harus dibayarkan Rp."<<jumlah_bayar;
getch();
}
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0 Response to "Membuat program potongan harga/diskon >>> Dev C++"
Post a Comment