Yang Minat Jualan Pulsa Gak Pake Ribet WAJIB Klik Gambar

Jumat, 18 Oktober 2013

Tugas C++ (Tiket Pesawat)

Nama      :Eko Budi S
Nim         :13130421
Kelas       :13.IA.21





#include <conio.h>
#include <iostream.h>
#include <stdio.h>
main()
{
char ulng,kd,kls,nm[15];
int hrg=0,jml,tot,byr,kmbl;
atas:
clrscr();
cout<<"\t\t\t TIKET PESAWAT \t\t\t"<<endl;
cout<<"\t\t\t Jakarta - Malaysia \t\t\t"<<endl;
cout<<"==================================================="<<endl;
cout<<"Masukan Kode Pesawat[MPT/GRD/BTV]:";cin>>kd;
cout<<"Kelas Pesawat:"<<endl;
cout<<"\t 1. Executive \t"<<endl;
cout<<"\t 2. Bisnis \t"<<endl;
cout<<"\t 3. Ekonomi \t"<<endl;
cout<<"Kelas Pesawat[1/2/3]:";cin>>kls;
if(kd=='M'||kd=='m')
{
  strcpy(nm,"Merpati");
  if(kls=='1')
  hrg=1500000;
  if(kls=='2')
  hrg=900000;
  if(kls=='3')
  hrg=500000;
}
else
if(kd=='G'||kd=='g')
{
  strcpy(nm,"Garuda");
  if(kls=='1')
  hrg=1200000;
  if(kls=='2')
  hrg=800000;
  if(kls=='3')
  hrg=400000;
}
else
if(kd=='B'||kd=='b')
{
 strcpy(nm,"Batavia");
 if(kls=='1')
 hrg=1000000;
 if(kls=='2')
 hrg=700000;
 if(kls=='3')
 hrg=300000;
}
else
{
cout<<"Salah Kode"<<endl<<endl;
cout<<"Input Ulang?[y/t]:";cin>>ulng;
if(ulng=='Y'||ulng=='y')
goto atas;
else
goto bawah;
}
cout<<"==================================================="<<endl;
cout<<"Nama Pesawat:"<<nm<<endl;
cout<<"Harga Tiket:"<<hrg<<endl;
cout<<"Jumlah Tiket:";cin>>jml;
tot=jml*hrg;
cout<<"Total Bayar:"<<tot<<endl;
cout<<"Uang Bayar:";cin>>byr;
kmbl=byr-tot;
cout<<"Uang Kembali:"<<kmbl<<endl;
cout<<"\t\t\t\t\t Input Ulang?[Y/T]: \t\t\t\t\t";cin>>ulng;
if(ulng=='Y'||ulng=='y')
goto atas;
else
goto bawah;
bawah:
getch();
}

Tidak ada komentar:

Posting Komentar