#include <conio.h>
#include <iostream.h>
void main() {
float belanja;
float diskon ;
float bayar ;
cout <<"masukkan banyak belanja :";
cin>> belanja;
if(belanja>=100000)
{diskon = 10/100*belanja;}
else if(belanja >=80000)
{diskon =8/100*belanja;}
else if(belanja>=60000)
{diskon=6/100*belanja;}
else
{diskon =0;}
bayar = belanja-diskon;
cout<<"anda mendapat diskon sebesar:"<<diskon<<endl;
cout <<"sehingga anda cukup membayar:"<<bayar<<endl;
getch();
}
Sign up here with your email
ConversionConversion EmoticonEmoticon