Langsung ke konten utama

Unggulan

Quiz Rekayasa Perangkat Lunak

  QUIS RPL Pert 15 (Review Pert 9 sd 14) Syafiil Ummah (17191042) 1. A (OBJEK) 2. A (STATE) 3. B (ENKAPSULASI) 4. C (PROSEDUR/FUNGSI) 5. C (TOP DOWN) 6. A (ARSITEKTUR SISTEM PL) 7. B (IMPLASI) 8. E (TAMPILAN DATA) 9. E (KINERJA) 10. C (KONEKTOR) 11. A (PERENCANAAN NAVIGASI) 12. A (TAMPILAN YANG AKAN DI LIHAT OLEH USER) 13. C (MENEMUKAN TAMPILAN DAN MEKANISME INTERAKSI) 14. D (WAKTU UNTUK KE PASAR) 15. B (STRUKTUR LINIER) 16. A (PENGUJIAN APLIKASI WEB) 17. B (KEBENARAN APLIKASI YANG DI SAJIKAN) 18. C (INTEROPERABILITAS) 19. D (CLIENT-SIDE SCRIPTING) 20. E (UNTUK MEMPALIDASI BAHWA SETIAP UNIT SEMANTIK NAVIGASI DAPAT DI CAPAI OLEH KATEGORI PENGGUNA YANG TEPAT) 21.B (IMPLEMENTASI) 22. C (SISTEM HOST) 23. D (KOMPONEN) 24. E (MANAGEMENT KONFIGURASI) 25. A (PEMELIHARAAN PREVENTIF)

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;

}

Komentar

Postingan Populer