Contoh Program Sederhana Penyewaan Rental Futsal

Dibawah ini Contoh Program Rental Penyewaan Lapangan Futsal dengan menggunakan program c++ dengan input dan output :

Gambar : Input Program



Gambar : Output Program
Contoh Program :

#include <stdio.h>
#include <conio.h>
#include <iostream.h>

main()
{
char kl[30],nl[30],lagi;
int a,b,c,hrg,jj,tot,byr,kmbl;
atas:
cout<<"Author : Johan Andy Agasi"<<endl;
cout<<"Silahkan Kunjungi Blogger : http://johanandyagasi.blogspot.com"<<endl;
cout<<""<<endl;
cout<<"==================================="<<endl;
cout<<"           FUTSAL MAESTRO                "<<endl;
cout<<"==================================="<<endl;
cout<<"Masukan Kode lapangan[LNT/KPT/SYN] =";cin>>kl;
cout<<"Masukan Jumlah Jam =";cin>>jj;
cout<<"==================================="<<endl;
clrscr();
a=strcmp(kl,"LNT");
b=strcmp(kl,"KPT");
c=strcmp(kl,"SYN");
if(a==0||a==32)
{
strcpy(nl,"LANTAI");
hrg=30000;
}
else if(b==0||b==32)
{
strcpy(nl,"KARPET");
hrg=50000;
}
else if(c==0||c==32)
{
strcpy(nl,"SYNTETIC");
hrg=60000;
}
else
{
goto atas;
}
cout<<"          FUTSAL MAESTRO             "<<endl;
cout<<"==================================="<<endl;
cout<<"Jenis Lapangan        ="<<nl<<endl;
cout<<"Harga Sewa perjam     ="<<hrg<<endl;
cout<<"Total Jam             ="<<jj<<endl;
tot=jj*hrg;
cout<<"   Total Bayar    ="<<tot<<endl;
cout<<"   Bayar          =";cin>>byr;
kmbl=byr-tot;
cout<<"   Kembali        ="<<kmbl<<endl;
cout<<"==================================="<<endl;
cout<<"============Terima Kasih==========="<<endl;
cout<<"Mau Input Data Lagi (Y/T) =";cin>>lagi;
if(lagi=='Y'||lagi=='y')
goto atas;
else
cout<<"===TerimaKasih===";
getch();
} 

Sobat sendiri bisa mengedit program di atas dengan menghilangkan author nyadengan menghapus kode :

cout<<"Author : Johan Andy Agasi"<<endl;
cout<<"Silahkan Kunjungi Blogger : http://johanandyagasi.blogspot.com"<<endl;
cout<<""<<endl;


Demikian Contoh Program Rental Penyewaan Lapangan Futsal yang saya share ke sobat :')

Semoga Bermanfaat :D
0 Komentar untuk " Contoh Program Sederhana Penyewaan Rental Futsal "