Arinal Hidayat
Senin, 11 November 2013
Hasil UTS Algoritma Pemrograman Semester 1 BSI
#include
#include
#include
main()
{
char nampet[10],namcust[10],kode[15],*jenis;
int lama,harga,total,diskon,grand,ubay,ukem;
cout<<"TWENTY RENT CAR"<>nampet;
cout<<"Input Nama customer :";cin>>namcust;
cout<<"Input kode mobil[S/M/L :";cin>>kode;
cout<<"Input lama sewa :";cin>>lama;
if (strcmp(kode,"S")==0)
jenis="Sedan";
{
harga=250000;
}
if(strcmp(kode,"M")==0)
jenis="Mini Bus (25 seat)";
{
harga=300000;
}
if(strcmp(kode,"L")==0)
jenis="Limousin";
{
harga=450000;
}
total=harga*lama;
if(lama>3)
{
diskon=0.05*total;
}
else
diskon=0;
grand=total-diskon;
cout<<"TWENTY RENT CAR"<>ubay;
ukem=ubay-grand;
cout<<"uang kembali :"<
Langganan:
Postingan (Atom)