#include <iostream>
#include <conio.h>
#include <string.h>
using namespace std;
main ()
{char k[100], ulang; //k untuk input golongan parkir
int r=1, tm=0,gt=0, j[100], l; // tk = total
int n[100]; // n = lama parkir
int lb[100]; // perhitungan lebih parkir
long tc[100];//Total parkir
do
{cout<<" Pilih kode dibawah ini untuk pengisian Golongan Parkir : "<<endl;
cout<<"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
cout<<" 1. Ketik [1] jika golongan Mobil "<<endl;
cout<<" 2. Ketik [2] jika golongan Motor "<<endl;
cout<<"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
cin>>k[r];
cout<<" Input lama parkir : \n";
cin>>n[r];
if (k[r]=='1')
{j[r]=n[r];
if ( n[r]<=2 )
{tc[r]=2000;}
else if (n[r]>2)
{lb[r]=n[r]-2;
tc[r]=(lb[r]*1000)+2000;}
cout<<" Golongan "<<k[r]<< " lama parkir "<<n[r]<<"jam "<<endl;}
if (k[r]=='2')
{j[r]=n[r];
if ( n[r]<=2 )
{tc[r]=1000;}
else if (n[r]>2)
{lb[r]=n[r]-2;
tc[r]=(lb[r]*500)+1000; }
cout<<" Golongan "<<k[r]<< " lama parkir "<<n[r]<<"jam "<<endl;}
cout<<" \nUlang input ? [u/t] ";cin>>ulang;
gt=gt+tc[r];
r++;
}
while( ulang=='u');
cout<<"\n DIJAMIN ILANG PARKIR !!!\n ";
cout<<"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
cout<<"No\tGol\tJam\tTotal"<<endl;
cout<<"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
for (l=1;l<r;l++)
cout<<l<<"\t"<<k[l]<<"\t"<<j[l]<<"\t"<<tc[l]<<endl;
cout<<"\t\tGrand Total : "<<"\t"<<gt<<endl;
getch();
}
No comments:
Post a Comment