Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
3.5 kB
0
Indexable
Never
#include <iostream>
using namespace std;

int main()
{
    int pesan;
    float h1,h2,h3,durasi,duit,kembalian;
    

    cout << "|*** Selamat Datang di Warnet Udean ***|" << endl;
    cout << "-----------------------------------------------------" << endl;
    cout << "Daftar Harga Warnet Udean" << endl;
    cout << "-----------------------------------------------------" << endl;
    cout << "No.\tJenis Member\tTipe PC \tHarga per-jam" << endl;
    cout << "1. \tNon-Reguler \tNon-Gaming \tRp.5000" << endl;
    cout << "2. \tReguler     \tGTX        \tRp.8000" << endl;
    cout << "3. \tSultan      \tRTX        \tRp.15000" << endl;
    cout << "-----------------------------------------------------" << endl;
    cout << "4.\tKeluar" << endl;

    cout << "\nPilih Member no.(1-4) : ";
    cin >> pesan;

    system("cls");

    switch(pesan)
    {
        case 1:
            cout << "Anda telah menjadi member : Non-Reguler" << endl;
            cout << "---------------------------------------" << endl;
            cout << "Mau pesan berapa jam? (input angka) :  ";
            cin >> durasi;
            h1 = (durasi * 5000);
            cout << "Harga : Rp. " << h1 << endl;
            cout << "Masukkan duit anda (input angka) : ";
            cin >> duit;
            kembalian = duit - h1;

            system("cls");

            if (duit > h1)
            {
                cout << "Member : Non-Reguler" << endl;
                cout << "Kembalian : Rp." << kembalian << endl;
                cout << "Have Fun And Enjoy";
            } else 
            {
                cout << "Maaf duit anda kurang";
            }
            break;
        case 2:
            cout << "Anda telah menjadi member : Reguler" << endl;
            cout << "-----------------------------------" << endl;
            cout << "Mau pesan berapa jam? (input angka) : ";
            cin >> durasi;
            h2 = (durasi * 8000);
            cout << "Harga : Rp. " << h2 << endl;
            cout << "Masukkan duit anda (input angka) : ";
            cin >> duit;
            kembalian = duit - h2;

            system("cls");

            if (duit > h2)
            {
                cout << "Member : Reguler" << endl;
                cout << "Kembalian : Rp." << kembalian << endl;
                cout << "Have Fun And Enjoy";
            } else 
            {
                cout << "Maaf duit anda kurang";
            }
            break;
        case 3:
            cout << "Anda telah menjadi member : Sultan" << endl;
            cout << "----------------------------------" << endl;
            cout << "Mau pesan berapa jam? (input angka) : ";
            cin >> durasi;
            h3 = (durasi * 15000);
            cout << "Harga : Rp. " << h3 << endl;
            cout << "Masukkan duit anda (input angka) : ";
            cin >> duit;
            kembalian = duit - h3;

            system("cls");

            if (duit > h3)
            {
                cout << "Member : Non-Reguler" << endl;
                cout << "Kembalian : Rp." << kembalian << endl;
                cout << "Have Fun And Enjoy";
            } else 
            {
                cout << "Maaf duit anda kurang";
            }
            break;
        case 4:
            cout << "Silahkan datang kembali" << endl;
            break;
        default:
            cout << "Pilihan anda tidak valid" << endl;
    }
}