Minggu, 15 April 2018

converter mata uang, suhu, dan umur

selamat malam guys ^_^
semoga kalian sehat selalu ya,,,
kali ini saya akan memberikan sedikit yang saya tahu tentang aplikasi menggunakan C++.
langsung simak aja koding nya ya,,,


#include <iostream>
#include <stdlib.h>

using namespace std;

int main()
{
    int a,c,pil,suhu,kode,rupiah,tgl,umur;
    float r,f,k,dolar;
    char d;
awal:
    system ("cls");
    cout<< "WELCOME TO CONVERTER"<<endl;
    cout<< "~~~~~~~~~~~~~~~~~~~~"<<endl;
    cout<< "1. MATA UANG"<<endl;
    cout<< "2. SUHU     "<<endl;
    cout<< "3. UMUR     "<<endl;
    cout<< "Masukkan Pilihan Anda : ";
    cin>>pil;
    cout<< "\n";
    switch (pil)

    {
    case 1:
        cout<< "==PENGUBAH MATA UANG=="<<endl;
        cout<< "----------------------"<<endl;
        cout<< "1. RUPIAH->DOLLAR"<<endl;
        cout<< "2. DOLLAR->RUPIAH"<<endl;
        cout<<endl;
        cout<< "SILAHKAN PILIH MATA UANG YG AKAN DIUBAH : ";
        cin>>kode;
        cout<< "----------------------------------------- "<<endl;
        cout<<endl;
        switch (kode)

        {
        case 1:
            cout<< "masukkan jumlah mata uang : ";
            cin>>a;
            cout<< "---------------------------"<<endl;
            cout<< "\n";
            dolar=a/13000;
            cout<<"Rp."<<a<< " = "<<"$."<<dolar<<endl;
            cout<< "==========================="<<endl;
            break;

        case 2:
            cout<< "masukkan jumlah mata uang : ";
            cin>>a;
            cout<< "---------------------------"<<endl;
            rupiah=a*13000;
            cout<< "$"<<a<< " = "<<"Rp."<<rupiah<<endl;
            cout<< "==========================="<<endl;
            break;
        }

        cout<< "Ingin Mencoba Lagi? [Y/N] : ";
        cin>>d;
        if (d=='Y' || d=='y')
        {
            goto awal;
        }
        system ("cls");
        return 0;

    case 2:
        cout<< "==PENGUKUR SUHU=="<<endl;
        cout<< "-----------------"<<endl;
        cout<< "1. CELSIUS->REAMUR     "<<endl;
        cout<< "2. CELCIUS->FAHRENHEIT "<<endl;
        cout<< "3. CELCIUS->KELVIN     "<<endl;
        cout<< "\n";
        cout<< "SILAHKAN PILIH PENGUKURAN SUHU : ";
        cin>>suhu;
        cout<< "-------------------------------- "<<endl;
        switch (suhu)
        {
        case 1:
            cout<< "Masukkan Ukuran Suhu : ";
            cin>>c;
            cout<< "---------------------- "<<endl;
            r=4*c/5;
            cout<<c<<" [celcius] "<<" = "<<r<<" [reamur] "<<endl;
            cout<< "============================  "<<endl;
            break;

        case 2:
            cout<< "Masukkan Ukuran Suhu : ";
            cin>>c;
            cout<< "---------------------- "<<endl;
            f=9*c/5+32;
            cout<<c<<" [celcius] "<<" = "<<f<<" [fahrenheit] "<<endl;
            cout<< "=================================  "<<endl;
            break;

        case 3:
            cout<< "Masukkan Ukuran Suhu : ";
            cin>>c;
            cout<< "---------------------- "<<endl;
            k=c+273;
            cout<<c<<" [celcius] "<<" = "<<k<<" [kelvin] "<<endl;
            cout<< "=============================  "<<endl;
            break;
        }
        cout<< "\n";
        cout<< "Ingin Mencoba Lagi? [Y/N] : ";
        cin>>d;
        if (d=='Y' || d=='y')
        {
            goto awal;
            system ("cls");
        }
        else
        {
            system ("exit");
            return 0;
        }
    case 3:
        cout<< "==PENGHITUNG UMUR=="<<endl;
        cout<< "-------------------"<<endl;
        cout<< "\n";
        cout<< "Masukkan Tahun Lahir Anda (contoh 1996) : ";
        cin>>tgl;
        cout<< "----------------------------------------- "<<endl;
        umur=2016-tgl;
        cout<< "Umur Anda Sekarang Adalah : "<<umur<<" tahun "<<endl;
        cout<< "==================================== "<<endl;
        cout<< "\n";
        cout<< "Ingin Mencoba Lagi? [Y/N] : ";
        cin>>d;
        if (d=='Y' || d=='y')
        {
            goto awal;
            system ("cls");
        }
        else if (d=='N' || d=='n')
        {
            system ("exit");
            return 0;
        }
    default:
        cout<< "Data yg Anda Masukkan Tidak Valid"<<endl;
        cout<< "\n";
        cout<< "Ingin Mencoba Lagi? [Y/N] : ";
        cin>>d;
        if (d=='Y' || d=='y')
        {
            goto awal;
            system ("cls");
        }
        else if (d=='N' || d=='n')
        {
            system ("exit");
            return 0;
        }

    }



}

maka jika program dijalankan akan muncul hasilnya seperti berikut ini guys,,,




selamat mencoba guys,,,,
semoga sukses ^_^

0 comments:

Posting Komentar

http://www.resepkuekeringku.com/2014/11/resep-donat-empuk-ala-dunkin-donut.html http://www.resepkuekeringku.com/2015/03/resep-kue-cubit-coklat-enak-dan-sederhana.html http://www.resepkuekeringku.com/2014/10/resep-donat-kentang-empuk-lembut-dan-enak.html http://www.resepkuekeringku.com/2014/07/resep-es-krim-goreng-coklat-kriuk-mudah-dan-sederhana-dengan-saus-strawberry.html http://www.resepkuekeringku.com/2014/06/resep-kue-es-krim-goreng-enak-dan-mudah.html http://www.resepkuekeringku.com/2014/09/resep-bolu-karamel-panggang-sarang-semut-lembut.html