#include "stdio.h"
#include "conio.h"
#include "iostream.h"
#include "iomanip.h"
garis1()
{cout<<"\n_________________________________________\n";}
garis2()
{cout<<"\n-----------------------------------------\n";}
char *merk(char kode)
{
if((kode=='H')||(kode=='h'))
{return "Honda";}
else if((kode=='S')||(kode=='s'))
{return "suzuki";}
else if((kode=='K')||(kode=='k') )
{return "Kawasaki";}
else
{return "Yamaha";}
}
float hrg(char kode)
{
if((kode=='H')||(kode=='h'))
{return 14000000;}
else if((kode=='S')||(kode=='s'))
{return 12500000;}
else if((kode=='K')||(kode=='k'))
{return 21000000;}
else
{return 13500000;}
}
main()
{
int i,jml;
float t,ppn,hb,ub,uk,pt;
struct
{
char nama[15],brg[8],kode;
int ji,jml;
float hrg,total;
}jual[20];
clrscr();
cout<<" DEALER DUA RODA "<
cout<
garis2();
for(i=1;i<=jml;i++)
{
cout<<"Data ke- "<cout<<"Nama Pembeli : ";cin>>jual[i].nama;
cout<<"Kode motor[H/S/K/Y] : ";cin>>jual[i].kode;
jual[i].total=hrg(jual[i].kode)*jual[i].ji;
t=t+jual[i].total;
}
clrscr();
cout<<" LAPORAN PENJUALAN MOTOR "<
cout<<"NO NAMA PEMBELI KODE MERK HARGA TOTAL "<
for(i=0;i<=jml;i++)
{
cout<
garis1();
cout<<"Total keseluruhan Rp. "<
pt=(0.025*t);
cout<<"Potongan 2,5% :Rp. "<
hb=(ppn+t)-pt;
cout<<"harga bersih :Rp. "<
uk=ub-hb;
garis1();
cout<<"uang kembali :Rp. "<
}
0 komentar