Pada kali ini saya akan membuat program tentang sewa baju sederhana dengan menggunakan Dev C++ . pada program ini saya membuat jenis baju,pilihan sewa hari, ukuran baju, setiap pilihan dengan harga yang berbeda.. okee tinggal copy aja yaak nih codingnya :D ...
------------------------------------------------------------------------------------------------------------
#include <stdio.h>
#include <conio.h>
#include <iostream>
#include <windows.h>
using namespace std;
main()
{
char kd, ukuran[10],ksr[20],nm[25];
float trs,jmlh,uang,hrg,jmlhrg,byr,kmbl,disc,hrg1;
/* buat nama tempat dan baju bajunya sesuai keingan kamu yaak */
cout<<"\t\t SEWA PAKAIAN ADAT VINCENT"<<endl;
cout<<"\t ********************************************"<<endl;
cout<<"\n---------------------------Silahkan pilih KODE PAKAIAN -----------------------"<<endl;
cout<<"\n |JB=PAKAIAN ADAT JAWA BARAT|"<<endl;
cout<<"\n |JT = PAKAIAN ADAT JAWA TIMUR|"<<endl;
cout<<"\n |SB = PAKAIAN ADAT SURABAYA|"<<endl;
cout<<"\n----------------------------------TERIMA KASIH-------------------------------"<<endl;
cout<<"\n"<<endl;
cout<<"masukan kode pakaian adat[JB/JT/SB] :";cin>>ksr;
cout<<"ukuran pakian [S/M/L] :";cin>>kd;
cout<<"lama sewa pakian :";cin>>jmlh;
/* logika IF ELSE perhitungan harga dan jenis baju */
if(kd=='S'||kd=='s')
{strcpy(ukuran,"S");
hrg =200000;
}
else if(kd=='M'||kd=='m')
{strcpy(ukuran,"M");
hrg=250000;
}
else if(kd=='L'||kd=='l')
{strcpy(ukuran,"L");
hrg=275000;
}
else
{strcpy(ukuran,"-");
hrg=0;
}
if(strcmp(ksr,"JB")==0||strcmp(ksr,"jb")==0)
{strcpy(nm,"jawa barat");
}
else if(strcmp(ksr,"JT")==0||strcmp(ksr,"jt")==0)
{strcpy(nm,"jawa timur");
}
else if(strcmp(ksr,"sb")==0||strcmp(ksr,"SB")==0)
{strcpy(nm,"surabaya");
}
else
{strcpy(nm,"-");
}
jmlhrg=hrg*jmlh;
disc=jmlhrg*15/100;
byr=jmlhrg-disc;
/* Penutup */
cout<<"\t Struktur Sewa pakian adat "<<endl;
cout<<"*************************************************************************"<<endl;
cout<<"nama pakaian adat :"<<nm<<endl;
cout<<"ukuran pakaian :"<<ukuran<<endl;
cout<<"Harga sewa perhari :Rp."<<hrg<<endl;
cout<<"lama sewa pakaian :"<<jmlh<<endl;
cout<<"Jumlah Harga :Rp."<<jmlhrg<<endl;
cout<<"Discount :Rp."<<disc<<endl;
cout<<"*************************************************************************"<<endl;
cout<<"Total Bayar :Rp."<<byr<<endl;
cout<<"Jumlah Uang Bayar :Rp.";cin>>uang;
kmbl=uang-byr;
cout<<"Uang Kembalian :Rp."<<kmbl<<endl;
cout<<" "<<endl;
cout<<" "<<endl;
cout<<"\t TERIMAKASIH"<<endl;
cout<<"_________________________________________________________________________"<<endl;
cout<<"\t ***\t UAS BY : ***"<<endl;
cout<<"\t ***\t angga vincentius ***"<<endl;
getch();
}
---------------------------------------------------------------------------------------------------------------------------
Hasil Tampil
Coding di atas tinggal di copy, silahkan berimajinasi dan mengeditnya.. selamat mencoba