TUGAS AP3
Kelompok 7
Kelas 2IA22
Cindy Amriyani (51412169)
Rezqie Fadilla (56412224)
Satrio Priambudi (56412880)
LIstng Program :
#include<stdio.h>
#include<conio.h>
#include<iostream.h>
#include<string.h>
int main()
{
char maskapai[20],nama[20],rute[30],jawab,kode_penerbangan;
int jml;
long int harga,total;
awal:
clrscr();
cout<<"Created by 2IA22\n";
cout<<"Kelompok 7\n";
cout<<"Cindy A, Rezqie F, Satrio P\n";
cout<<"\n";
cout<<"\n|*****************************************************************|";
cout<<"\n Backpacker Tour and
Travel";
cout<<"\n|*****************************************************************|";
cout<<"\n|_________________________________________________________________|";
cout<<"\n| Kode penerbangan | Rute | Harga |";
cout<<"\n| 1.PDG-JKT | Padang-Jakarta | 500.000 |";
cout<<"\n| 2.PDG-SIN | Padang-Singapura | 400.000 |";
cout<<"\n| 3.JKT-LOM | Jakarta-Lombok | 600.000 |";
cout<<"\n| 4.KL-PDG | Kuala Lumpur-Padang | 300.000 |";
cout<<"\n| 5.JKT-SIN | Jakarta-Singapura | 350.000 |";
cout<<"\n|_________________________________________________________________|";
cout<<"\n Nama Penumpang : ";
cin>>nama;
cout<<"\n Kode Penerbangan (1-5) : ";
cin>>kode_penerbangan;
if (kode_penerbangan=='1')
{
cout<("Padang - Jakarta");
cin>>rute;
strcpy(maskapai,"Lion Air");
harga=500000;
}
else if (kode_penerbangan=='2')
{
strcpy(rute,"Padang - Singapura");
strcpy(maskapai,"Air Asia");
harga=400000;
}
else if (kode_penerbangan=='3')
{
strcpy(rute,"Jakarta - Lombok");
strcpy(maskapai,"Garuda Indonesia");
harga=600000; }
else if (kode_penerbangan=='4')
{
strcpy(rute,"Kuala Lumpur - Padang");
strcpy(maskapai,"Air Asia");
harga=300000;
}
else if (kode_penerbangan=='5')
{
strcpy(rute,"Jakarta - Singapura");
strcpy(maskapai,"Sriwijata Air");
harga=350000;
}
else
{
cout<<"\n Kode Pesawat yang Anda Masukan
Salah"<<endl;
cout<<"\n Mau Input Data Lagi [Y/T]?";
jawab=getch();
if (jawab=='Y'||jawab=='y')
goto awal;
else
goto awal;
}
cout<<"\n Jumlah Tiket : ";cin>>jml;
total=jml*harga;
cout<<"\n Penumpang Yang Bernama :
"<<nama<<endl;
cout<<"\n Maskapai :
"<<maskapai<<endl;
cout<<"\n Rute : "<<rute<<endl;
cout<<"\n Harga Tiket :
"<<harga<<endl;
cout<<"\n Total Bayar :
"<<total<<endl;
cout<<"\n
_________________________"<<endl;
cout<<"\n Mau Input Data Lagi [Y/T]?";
jawab=getch();
if (jawab=='Y'||jawab=='y')
goto awal;
getch();
return 0;
}
OUTPUT :
Tidak ada komentar:
Posting Komentar