Membuat Program Tiket Pesawat Menggunakan c++
#include <stdio.h>
#include <conio.h>
#include <iostream.h>
main ()
{
char kode[4],*napes,bk[8],lagi;
int c1,c2,c3,jubel,harga,total;
atas:
clrscr();
cout<<" PROGRAM TIKET PESAWAT"<<endl;
cout<<" JAKARTA-MEDAN"<<endl;
cout<<"--------------------------------------------"<<endl;
cout<<endl;
cout<<" Masukan Kode Pesawat [MPT/GRD/BVT]: ";cin>>kode;
cout<<"Kelas Pesawat:"<<endl;
cout<<" 1.Executive"<<endl;
cout<<" 2.Bisnis"<<endl;
cout<<" 3.Ekonomi"<<endl;
cout<<" Pilih kelas [1/2/3]: ";cin>>bk;
c1=strcmp(kode,"MPT");c2=strcmp(kode,"GRD");c3=strcmp(kode,"BVT");
if (c1==0||c1==32)
{
napes="Merpati";
if(bk=="1")
{
harga=1500000;
}
else if(bk=="2")
{
harga=900000;
}
else{ harga=500000;}
}
else if( c2==0||c2==32)
{
napes="Garuda";
if(bk=="1")
{
harga=1200000;
}
else if(bk=="2")
{
harga=800000;
}
else {harga=400000;}
}
else if (c3==0||c3==32 )
{
napes="Batavia";
if(bk=="1")
{
harga=1000000;
}
else if(bk=="2")
{
harga=700000;
}
else {harga=300000; }
}
cout<<" Nama pesawat : "<<napes<<endl;
cout<<" Harga tiket : "<<harga<<endl;
cout<<" Jumlah Beli : ";cin>>jubel;
total=harga*jubel;
cout<<" Total Bayar : "<<total<<endl;
cout<<"\n\Ingin Input Lagi [Y/T] : ";cin>>lagi;
if (lagi == 'Y' || lagi == 'y')
goto atas;
getch();
}
romeimpun
Langganan:
Posting Komentar (Atom)
Kata-Kata Kebersamaan dengan Keluarga
Keluarga merupakan sekumpulan orang yang begitu dekat dan berharga bagi kita. Sebab, bersama keluargalah kehidupan kita dimulai dan terus ...
-
ROMAJI: Komorebi ga yasashiku sashikomu ooki na mado no naka Kimi to deatta ano hi wo tooku ni kanjita Sukoshizutsu narabeta omoide ...
-
Tegami ~Haikei Juugo no Kimi e~ Lyrics 手紙 ~拝啓 十五の君へ~ 歌詞 Lirik Lagu Tegami ~Haikei Juugo no Kimi e~ English Romanized Kanji Indone...
Tidak ada komentar:
Posting Komentar