Beruflich Dokumente
Kultur Dokumente
Disusun oleh
Acep 2022340007
FAKULTAS INFORMATIKA
BEKASI
2022
#include <conio.h>
#include <iostream>
#include <string.h>
int main()
struct
}tiket;
char lagi;
atas:
cout<<"=================================================="<<endl;
cout<<"=================================================="<<endl;
cout<<"=================================================="<<endl;
cout<<"=================================================="<<endl;
if (strcmp(tiket.kode, "AG")==0)
strcpy(tiket.nama_kelas, "Executive");
tiket.harga=800000;
else if(tiket.kelas=='2')
strcpy(tiket.nama_kelas, "Bisnis");
tiket.harga=500000;
else if(tiket.kelas=='3')
strcpy(tiket.nama_kelas, "Ekonomi");
tiket.harga=250000;
else
}}
if (strcmp(tiket.kode, "AL")==0)
if (tiket.kelas=='1')
{strcpy(tiket.nama_kelas, "Executive");
tiket.harga=700000;}
else if(tiket.kelas=='2')
{strcpy(tiket.nama_kelas, "Bisnis");
tiket.harga=400000;}
else if(tiket.kelas=='3')
{strcpy(tiket.nama_kelas, "Ekonomi");
tiket.harga=200000;}
else
}}
if (strcmp(tiket.kode, "PH")==0)
strcpy(tiket.nama_kereta, "Parahyangan");
if (tiket.kelas=='1')
{strcpy(tiket.nama_kelas, "Executive");
tiket.harga=600000;}
else if(tiket.kelas=='2')
{strcpy(tiket.nama_kelas, "Bisnis");
tiket.harga=350000;}
else if(tiket.kelas=='3')
{strcpy(tiket.nama_kelas, "Ekonomi");
tiket.harga=175000;}
else
tiket.bayar=tiket.jumbel*tiket.harga;
system("cls") /*clear output screen*/;
if (tiket.jumbel>=10)
{tiket.diskon=tiket.bayar*0.25;}
else if (tiket.jumbel>5)
{tiket.diskon=tiket.bayar*0.1;}
else
{tiket.diskon=tiket.bayar*0;}
cout<<"Pembayaran :"<<tiket.bayar<<endl;
cout<<"diskon :"<<tiket.diskon<<endl;
cout<<"=================================================="<<endl;
tiket.tot_bay=tiket.bayar-tiket.diskon;
tiket.uang_kem=tiket.pembayaran-tiket.tot_bay;
cout<<""<<endl;
cout<<""<<endl;
if(lagi=='y' || lagi=='Y')
goto atas;
getch();
}
Outputnya