Code C + + simple program total price
#include <iostream.h>
#include <conio.h>
void main ()
{
long int hrg,jsa,tot;
int p,a;
float pj;
cout << " Program Simple Total Harga " <<endl;
cout << "By : Devia Christa " <<endl;
cout << endl;
cout << "Harga per paket : Rp.15.000,00" <<endl;
cout << "Pajak : 10%" <<endl;
cout << "Jasa Antar : Rp.1.000,00" <<endl;
cout << "-----------------------------------------" <<endl;
cout << "Banyaknya paket yang dibeli : " ;
cin >> p;
cout << "Memakai jasa antar [y/t] : ";
cin >>a;
if ((a=59)||(a=121))
jsa=p*1000;
else
if ((a=74)||(a=116))
jsa=p*0;
hrg=p*15000;
pj=0.1*hrg;
tot=hrg+jsa+pj;
cout << "-----------------------------------------" <<endl;
cout << "Harga : " << hrg << endl;
cout << "Pajak : " <<pj <<endl;
cout << "Biaya Antar : " << jsa <<endl;
cout << "-----------------------------------------" <<endl;
cout << "Total : " << tot <<endl;
cout << "tekan sembarang tombol untuk keluar!" <<endl;
getch();
}
No comments:
Post a Comment