How to write a C++ Program to Convert Pak Rupees | Virtual Study Solutions

Adsetra Ads

 

Write a C++ Program to Convert Currency

Dear students, Today in C++ Tutorial we will learn how to write C++ Program to Convert Pak Rupees into Foreign Currency. In this tutorial i will going to show you how to Convert Pak Rupees into Foreign Currency using c++ programming language. Previously we shared Student Management System Project in C++.

How to write a C++ Program to Convert Pak Rupees into Foreign Currency
How to write a C++ Program to Convert Pak Rupees into Foreign Currency

C++ Program Source Code

Here is the source Code of C++ Program to Convert Pak Rupees into Foreign Currency:

#include<iostream>
#include<conio.h>
using namespace::std; 
main()
{
float Pakrupees;
int n;
float dollar,yen,euro,pound;
char ch,cha;

do
{
cout<<"Main menu"<<endl;
cout<<"select the mode of conversion"<<endl;
cout<<"enter 1 for the conversion of Pakistanirupees into one of the foreign currencies"<<endl;
cout<<"enter 2 for the conversion  of one of the foreign currencies into Pakistanirupees"<<endl;
cout<<"enter the mode:"<<endl;
cin>>n;

if(n==1)
{

cout<<"enter 'u' to get equivalent of your money in US Dollars"<<endl;
cout<<"enter 'p' to get equivalent of your noney in Pounds"<<endl;
cout<<"enter 'e' to get equivalent of your money in Euros"<<endl;
cout<<"enter 'y' to get equivalent of your money in Yen"<<endl;
cout<<"enter your choice:"<<endl;
cin>>ch;
cout<<"enter amount in Pakrupees:"<<endl;
cin>>Pakrupees;

switch(ch)
{
case 'u':
dollar=Pakrupees/59.44;
cout<<"US Dollar"<<"    "<<dollar<<endl;
break;
case 'p':
pound=Pakrupees/87.34;
cout<<"UK pound"<<"   "<<pound<<endl;
break;
case 'e':
euro=Pakrupees/69.00;
cout<<"eurpion union"<<"   "<<euro<<endl;
break;
case 'y':
yen=Pakrupees/0.02;
cout<<"japanes yen"<<"   "<<yen<<endl;
break;
default:
cout<<"wrong selection"<<endl;
}
}


if(n==2)
{
  cout<<"enter 'u' for getting equivalent of US Dolars in Pakistanirupees"<<endl;
cout<<"enter 'p' for getting equivalent of Pounds in Pakistanirupees"<<endl;
cout<<"enter 'e' for getting equivalent of Euros in Pakistanirupees "<<endl;
cout<<"enter 'y' for etting equivalent of Yen in Pakistanirupees"<<endl;
cout<<"enter your choice:"<<endl;
cin>>ch;
switch(ch)
{
case 'u':
cout<<"enter dollar"<<endl;
cin>>dollar;
Pakrupees=dollar*59.44;
cout<<"Pakrupees"<<"    "<<Pakrupees<<endl;
break;
case 'p':
cout<<"enter pounds"<<endl;
cin>>pound;
Pakrupees=pound*87.34;
cout<<"Pakrupees"<<"   "<<Pakrupees<<endl;
break;
case 'e':
cout<<"enter euro"<<endl;
cin>>euro;
Pakrupees=euro*69.00;
cout<<"Pakrupees"<<"   "<<Pakrupees<<endl;
break;
case 'y':
cout<<"enter yen"<<endl;
cin>>yen;
Pakrupees=yen*0.02;
cout<<"Pakrupees"<<"   "<<Pakrupees<<endl;
break;
default:
cout<<"wrong selection"<<endl;
}
}
cout<<"do you want to continue enter y/n"<<endl;
cin>>cha;
}
while(cha=='y'/'n') ;
getch();
}

MORE C++ PROGRAMMING EXAMPLE CODES


Tags: c++, C++ language, C++ Programming Language, C++ Programming Tutorial, How to  write C++ Program, c++ tutorials, C++ Program to Convert Pak Rupee, How to write C++ Program, Convert Pak Rupees into Foreign Currency

If you have any queries related to How to write C++ program to Convert Pak Rupees into Foreign Currency please share with us in comments:

إرسال تعليق

  1. thnx a lot bro... 1st assign b is se mlti jlti hi hy.... gud keep it up

    ردحذف
  2. أزال أحد مشرفي المدونة هذا التعليق.

    ردحذف

 

Top