Unggulan
- Dapatkan link
- X
- Aplikasi Lainnya
Program Sewa Mobil di C++
#include <iostream>
#include <conio.h>
#include <string.h>
using namespace std;
int main()
{
awal:
int l_sewa;
char nama [30];
char pil,yt;
cout<<"KELOMPOK COVID-19"<<endl;
cout<<"Erlando Pratama - 17191095"<<endl;
cout<<"Syafiil Ummah - 17191042"<<endl;
cout<<"Fahad Fauzi - 17190779"<<endl;
cout<<"Fachreza Rifki Nasution - 17190464"<<endl;
cout<<"Reza Pratama - 17190353"<<endl;
cout<<"\n\n\n"<<endl;
cout << " *RENTAL/SEWA MOBIL SUSAH SENANG* "<< endl;
cout << "----------------------------------------------------------------" << endl;
cout << "KODE Jenis Mobil Harga Sewa/Hari " << endl;
cout << " 1. Honda Jazz Rp. 350.000 " << endl;
cout << " 2. Piposs Rp. 500.000 " << endl;
cout << " 3. Marcedes Bens Rp. 800.000 " << endl;
cout << "----------------------------------------------------------------" << endl;
cout << "Nama : " ;cin>>nama;
cout << "Kode Mobil (1/2/3) : " ;cin>>pil;
cout << "Lama Sewa : " ;cin>>l_sewa;
system("cls");
if (pil=='1') {
int h_sewa,sub_tot,diskon,tot,bay,balik;
h_sewa=350000;
sub_tot=l_sewa*h_sewa;
if (l_sewa>=6) (diskon=sub_tot*0.1);
else (diskon=sub_tot*0);
tot=sub_tot-diskon;
cout << "Nama Penyewa : " <<nama<< endl;
cout << "Kode Mobil (1/2/3) : " <<pil<< endl;
cout << "Jenis Mobil : Sedan" << endl;
cout << "Harga Sewa/Hari : " <<h_sewa<< endl;
cout << "Lama peminjaman : " <<l_sewa<<" hari"<< endl;
cout << "Sub Total : Rp " <<sub_tot<<",-"<< endl;
cout << "Diskon : Rp " <<diskon<<",-"<< endl;
cout << "Total Bayar : Rp " <<tot<<",-"<< endl;
cout<<"----------------------------------------------------------------";
cout<<endl;
cout<<"Uang Bayar = Rp. ";cin>>bay;
balik=bay-tot;
cout<<"Uang Kembali = Rp. " <<balik<<",-"<< endl;
}
else if (pil=='2') {
int h_sewa,sub_tot,diskon,tot,bay,balik;
h_sewa=500000;
sub_tot=l_sewa*h_sewa;
if (l_sewa>=6) (diskon=sub_tot*0.1);
else (diskon=sub_tot*0);
tot=sub_tot-diskon;
cout << "Nama Penyewa : " <<nama<< endl;
cout << "Kode Mobil (1/2/3) : " <<pil<< endl;
cout << "Jenis Mobil : Mini Bus" << endl;
cout << "Harga Sewa/Hari : " <<h_sewa<< endl;
cout << "Lama peminjaman : " <<l_sewa<<" hari"<< endl;
cout << "Sub Total : Rp " <<sub_tot<<",-"<< endl;
cout << "Diskon : Rp " <<diskon<<",-"<< endl;
cout << "Total Bayar : Rp " <<tot<<",-"<< endl;
cout<<"----------------------------------------------------------------";
cout<<endl;
cout<<"Uang Bayar = Rp. ";cin>>bay;
balik=bay-tot;
cout<<"Uang Kembali = Rp. " <<balik<<",-"<< endl;
}
else if (pil=='3') {
int h_sewa,sub_tot,diskon,tot,bay,balik;
h_sewa=800000;
sub_tot=l_sewa*h_sewa;
if (l_sewa>=6) (diskon=sub_tot*0.1);
else (diskon=sub_tot*0);
tot=sub_tot-diskon;
cout << "Nama Penyewa : " <<nama<< endl;
cout << "Kode Mobil (1/2/3) : " <<pil<< endl;
cout << "Jenis Mobil : Bus" << endl;
cout << "Harga Sewa/Hari : " <<h_sewa<< endl;
cout << "Lama peminjaman : " <<l_sewa<<" hari"<< endl;
cout << "Sub Total : Rp " <<sub_tot<<",-"<< endl;
cout << "Diskon : Rp " <<diskon<<",-"<< endl;
cout << "Total Bayar : Rp " <<tot<<",-"<< endl;
cout<<"----------------------------------------------------------------";
cout<<endl;
cout<<"Uang Bayar = Rp. ";cin>>bay;
balik=bay-tot;
cout<<"Uang Kembali = Rp. " <<balik<<",-"<< endl;
}
else {
cout<<"Tidak Bisa Dipersoses";
cout<<endl;
}
cout<<endl;
cout<<"Apakah Sobat Ingin Coba Lagi ? [Y/T] : ";
cin>>yt;
cout<<endl;
if(yt=='Y' || yt=='y')
{goto awal;}
if(yt=='T' || yt=='t')
{goto selesai;}
selesai:
return 0;
}
- Dapatkan link
- X
- Aplikasi Lainnya
Postingan Populer
Pertemuan 14 Grafika Komputer - OpenGL & GLUT
- Dapatkan link
- X
- Aplikasi Lainnya
Komentar
Posting Komentar