Silahkan copas dan Edit ye
#include<stdio.h>
#include<conio.h>
#include<iostream.h>
#include<windows.h>
main()
{
char k_pesawat[20],n_pesawat[20],k_kelas[20],ulang;
long harga=0;
int j_tiket,total;
system("color b");
atas:
printf("\tRENTAL PESAWAT\n");
cout<<"Kode pesawat [MPT/GRD/BTV] = ";cin>>k_pesawat;
printf("\tMasukan Kelas :\n\t1.Executive\n\t2.Bisnis\n\t3.Bisnis\n");
cout<<"Kelas = ";cin>>k_kelas;
if(strcmp(k_pesawat,"MPT")==0||strcmp(k_pesawat,"mpt")==0)
{
strcpy(n_pesawat,"MERPATI");
if(strcmp(k_kelas,"01")==0||strcmp(k_kelas,"1")==0)
{
harga=1000;
}
else if(strcmp(k_kelas,"02")==0||strcmp(k_kelas,"2")==0)
{
harga=2000;
}
else if(strcmp(k_kelas,"03")==0||strcmp(k_kelas,"3")==0)
{
harga=3000;
}
else
{
gotoxy(20,13);
cout<<"Eror";
getch();
clrscr();
goto atas;
}
}
if(strcmp(k_pesawat,"GRD")==0||strcmp(k_pesawat,"grd")==0)
{
strcpy(n_pesawat,"GARUDA");
if(strcmp(k_kelas,"01")==0||strcmp(k_kelas,"1")==0)
{
harga=2000;
}
else if(strcmp(k_kelas,"02")==0||strcmp(k_kelas,"2")==0)
{
harga=3000;
}
else if(strcmp(k_kelas,"03")==0||strcmp(k_kelas,"3")==0)
{
harga=8000;
}
else
{
gotoxy(20,13);
cout<<"Eror";
getch();
clrscr();
goto atas;
}
}
if(strcmp(k_pesawat,"BTV")==0||strcmp(k_pesawat,"btv")==0)
{
strcpy(n_pesawat,"BATAVIA");
if(strcmp(k_kelas,"01")==0||strcmp(k_kelas,"1")==0)
{
harga=2000;
}
else if(strcmp(k_kelas,"02")==0||strcmp(k_kelas,"2")==0)
{
harga=3000;
}
else if(strcmp(k_kelas,"03")==0||strcmp(k_kelas,"3")==0)
{
harga=8000;
}
else
{
gotoxy(20,13);
cout<<"Eror";
getch();
clrscr();
goto atas;
}
}
else
{
gotoxy(20,13);
cout<<"Eror";
getch();
clrscr();
goto atas;
}
cout<<"Nama Pesawat = "<<n_pesawat<<endl;
cout<<"Harga = "<<harga<<endl;
cout<<"Jumlah tiket = ";cin>>j_tiket;
total=harga*j_tiket;
cout<<"Total = "<<total;
getch();
clrscr();
gotoxy(20,13);
cout<<"INGIN MENGULANG [y/t] = ";cin>>ulang;
clrscr();
if(ulang=='y')
{
goto atas;
}
else if(ulang=='t')
{
goto exit;
}
else
{
gotoxy(20,13);
cout<<"Eror";
getch();
clrscr();
goto atas;
}
getch();
exit:
}
#include<stdio.h>
#include<conio.h>
#include<iostream.h>
#include<windows.h>
main()
{
char k_pesawat[20],n_pesawat[20],k_kelas[20],ulang;
long harga=0;
int j_tiket,total;
system("color b");
atas:
printf("\tRENTAL PESAWAT\n");
cout<<"Kode pesawat [MPT/GRD/BTV] = ";cin>>k_pesawat;
printf("\tMasukan Kelas :\n\t1.Executive\n\t2.Bisnis\n\t3.Bisnis\n");
cout<<"Kelas = ";cin>>k_kelas;
if(strcmp(k_pesawat,"MPT")==0||strcmp(k_pesawat,"mpt")==0)
{
strcpy(n_pesawat,"MERPATI");
if(strcmp(k_kelas,"01")==0||strcmp(k_kelas,"1")==0)
{
harga=1000;
}
else if(strcmp(k_kelas,"02")==0||strcmp(k_kelas,"2")==0)
{
harga=2000;
}
else if(strcmp(k_kelas,"03")==0||strcmp(k_kelas,"3")==0)
{
harga=3000;
}
else
{
gotoxy(20,13);
cout<<"Eror";
getch();
clrscr();
goto atas;
}
}
if(strcmp(k_pesawat,"GRD")==0||strcmp(k_pesawat,"grd")==0)
{
strcpy(n_pesawat,"GARUDA");
if(strcmp(k_kelas,"01")==0||strcmp(k_kelas,"1")==0)
{
harga=2000;
}
else if(strcmp(k_kelas,"02")==0||strcmp(k_kelas,"2")==0)
{
harga=3000;
}
else if(strcmp(k_kelas,"03")==0||strcmp(k_kelas,"3")==0)
{
harga=8000;
}
else
{
gotoxy(20,13);
cout<<"Eror";
getch();
clrscr();
goto atas;
}
}
if(strcmp(k_pesawat,"BTV")==0||strcmp(k_pesawat,"btv")==0)
{
strcpy(n_pesawat,"BATAVIA");
if(strcmp(k_kelas,"01")==0||strcmp(k_kelas,"1")==0)
{
harga=2000;
}
else if(strcmp(k_kelas,"02")==0||strcmp(k_kelas,"2")==0)
{
harga=3000;
}
else if(strcmp(k_kelas,"03")==0||strcmp(k_kelas,"3")==0)
{
harga=8000;
}
else
{
gotoxy(20,13);
cout<<"Eror";
getch();
clrscr();
goto atas;
}
}
else
{
gotoxy(20,13);
cout<<"Eror";
getch();
clrscr();
goto atas;
}
cout<<"Nama Pesawat = "<<n_pesawat<<endl;
cout<<"Harga = "<<harga<<endl;
cout<<"Jumlah tiket = ";cin>>j_tiket;
total=harga*j_tiket;
cout<<"Total = "<<total;
getch();
clrscr();
gotoxy(20,13);
cout<<"INGIN MENGULANG [y/t] = ";cin>>ulang;
clrscr();
if(ulang=='y')
{
goto atas;
}
else if(ulang=='t')
{
goto exit;
}
else
{
gotoxy(20,13);
cout<<"Eror";
getch();
clrscr();
goto atas;
}
getch();
exit:
}