Categories
Pemprogramman C++

Program Konversi mata uang sederhana C++

Kali ini kami akan share program konversi mata uang C++ sederhana dimana kita bisa mengkonversi Mata uang rupiah ke dolar, Rupiah ke euro, rupiah ke pound inggris, rupiah ke yen dan rupiah ke ringgit malaysya, semoga ini bermanfaat.

#include<iostream>
#include<conio.h>

using namespace std;

main(){
 float rupiah, euro, yen, dollar, ringgit, pound; int pilih;
  cout<<"=============================================="<<endl;
  cout<<"\tKonversi Mata Uang"<<endl;
  cout<<"=============================================="<<endl;
  cout<<"1. Rupiah ke Dollar Amerika"<<endl;
  cout<<"2. Rupiah ke Euro"<<endl;
  cout<<"3. Rupiah ke Pound Inggris"<<endl;
  cout<<"4. Rupiah ke Yen Jepang"<<endl;
  cout<<"5. Rupiah ke Ringgit Malaysia"<<endl;
  cout<<"=============================================="<<endl;
  cout<<endl;
  cout<<"Input pilihan Anda  : ";cin>>pilih;
  cout<<endl;
  cout<<"=============================================="<<endl;

  if (pilih==1)
  {
    cout<<"\n1. Rupiah ke Dollar Amerika"<<endl;

    cout<<"----------------------------------------------"<<endl;
    cout<<"Input nilai rupiah  : ";cin>>rupiah;
    dollar = rupiah*0.00008;
    cout<<"Nilai Dollar Amerika  : "<<dollar<<endl;
   }

  else if(pilih==2)
  {
       cout<<"\n2. Rupiah ke Euro"<<endl;
    cout<<"Input nilai rupiah  : ";cin>>rupiah;
    euro = rupiah*0.00007;
    cout<<"Nilai Euro   : "<<euro<<endl;
   }
 
   else if(pilih==3)
  {
       cout<<"\n3. Rupiah ke Pound Inggris"<<endl;
    cout<<"Input nilai rupiah  : ";cin>>rupiah;
    pound = rupiah*0.00005;
    cout<<"Nilai Pound Inggris  : "<<pound<<endl;
   }
 
   else if(pilih==4)
  {
       cout<<"\n4. Rupiah ke Yen Jepang"<<endl;
    cout<<"Input nilai rupiah  : ";cin>>rupiah;
    yen = rupiah*0.00876;
    cout<<"Nilai Yen   : "<<yen<<endl;
   }

  else if(pilih==5)
   {
    cout<<"\n5. Rupiah ke Ringgit Malaysia"<<endl;
    cout<<"Input nilai rupiah  : ";cin>>rupiah;
    ringgit = rupiah*0.00032;
    cout<<"Nilai Ringgit   : "<<ringgit<<endl;}
    else {cout<<"\nPilihan Tidak Tersedia";
    cout<<endl;
   }
   cout<<endl;
   cout<<"=============================================="<<endl;
   cout<<endl;
}

Leave a Reply

Your email address will not be published. Required fields are marked *