1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
|
#include <conio>
#include <stdio>
#include <iostream>
#include <iomanip>
#define bersih() clrscr()
garis()
{cout<<"============================================================================"<<endl;}
main()
{
struct
{
char hari[10],tgl[3],bulan[10],tahun[5];
}service;
char kode[4][25], kol[4][25],*jenis[25],*namol[25],lagi;
int i,a,harga[25],jumbay[25],total=0,bayar,kembali;
awal:
bersih();
cout<<" \tBENGKEL MOTOR MEGALOBEAT"<<endl;
garis();
cout<<endl;
cout<<" Service Motor [SMT] : Rp. 25.000"<<endl;
cout<<" Service MOBIL [SMB] : Rp. 55.000"<<endl;
cout<<" Ganti Oli [GTO] : Rp. 30.000"<<endl;
cout<<endl;
garis();
cout<<" Hari : ";cin>>service.hari;
cout<<" Tanggal : ";cin>>service.tgl;
cout<<" Bulan : ";cin>>service.bulan;
cout<<" Tahun : ";cin>>service.tahun;
cout<<endl;
cout<<" Masukkan Jumlah Kendaraan Yang Di Service : ";cin>>a;
cout<<endl;
for(i=1;1<=a;i++)
{
cout<<" Data ke - "<<i<<endl;
cout<<endl;
cout<<" Masukan Kode Service [SM/SG/GO] : ";cin>>kode[i];
cout<<endl;
cout<<" Masukan Kode Oli [1/2/3/4] : ";cin>>kol[i];
cout<<endl;
if (!strcmp(kode[i],"SM")||!strcmp(kode[i],"sm"))
{strcpy(jenis[i],"Service Motor");
if(!strcmp(kol[i],"0"))
{namol[i]=" "; harga[i]=25000;}
else
{namol[i]=" "; harga[i]=25000;}
}
else
if (!strcmp(kode[i],"SG")||!strcmp(kode[i],"sg"))
{strcpy(jenis[i],"Serv. & Ganti Oli");
if(!strcmp(kol[i],"1"))
{namol[i]="Enduro"; harga[i]=56000;}
else
if(!strcmp(kol[i],"2"))
{namol[i]="Castrol"; harga[i]=57000;}
else
if(!strcmp(kol[i],"3"))
{namol[i]="Repsol"; harga[i]=58000;}
else
if(!strcmp(kol[i],"4"))
{namol[i]="Top One"; harga[i]=59000;}
else
{namol[i]="Kode Salah"; harga[i]=0;}
}
else
if (!strcmp(kode[i],"GO")||!strcmp(kode[i],"go"))
{strcpy(jenis[i],"Ganti Oli");
if(!strcmp(kol[i],"1"))
{namol[i]="Enduro"; harga[i]=31000;}
else
if(!strcmp(kol[i],"2"))
{namol[i]="Castrol"; harga[i]=32000;}
else
if(!strcmp(kol[i],"3"))
{namol[i]="Repsol"; harga[i]=33000;}
else
if(!strcmp(kol[i],"4"))
{namol[i]="Top One"; harga[i]=34000;}
else
{namol[i]="Kode Salah"; harga[i]=0;}
}
else
{strcpy(jenis[i],"Kode Salah");
namol[i]=" "; harga[i]=0;}
jumbay[i]=harga[i];
total=jumbay[i]+total;
cout<<endl;
}
bersih();
cout<<" \tBENGKEL SONIC GEAR"<<endl;
garis();
cout<<" Hari, : "<<service.hari; cout<<" Tanggal : "<<service.tgl; cout<<" "<<service.bulan;cout<<" "<<service.tahun;
cout<<endl;
garis();
cout<<"No. | No. Plat | Jenis Service | Oli | Jumbay "<<endl;
garis();
for(i=1;i<=a;i++)
{
cout<<setiosflags(ios::left)<<setw(6)<<i;
cout<<setiosflags(ios::left)<<setw(19)<<jenis[i];
cout<<setiosflags(ios::left)<<setw(19)<<namol[i];
cout<<setprecision(2)<<" "<<jumbay[i]<<endl;
cout<<endl;
}
cout<<endl;
garis();
cout<<" Total Bayar : Rp. "<<total<<endl;
cout<<endl;
cout<<" Bayar : Rp. ";cin>>bayar;
kembali=bayar-total;
cout<<endl;
cout<<" Kembali : Rp. "<<kembali<<endl;
garis();
cout<<"Mau Input Lagi? [Y/T] : ";cin>>lagi;
if (lagi=='Y'||lagi=='y')
goto awal;
else
goto akhir;
getch();
akhir:
}
|