Important alert: (current site time 5/22/2013 10:51:19 PM EDT)
 

VB icon

Currency Convertor

Email
Submitted on: 3/14/2002 8:39:21 AM
By: Geoffrey A. Overley  
Level: Beginner
User Rating: Unrated
Compatibility: C++ (general)
Views: 2710
(About the author)
 
     Our classes introduction to Switch statements. This program will convert any countries currency into any other countries currency. Also the program adds a 3.00 service charge for transaction.

 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
				
//**************************************
// Name: Currency Convertor
// Description:Our classes introduction to Switch statements.
This program will convert any countries currency into any other countries currency. Also the program adds a 3.00 service charge for transaction.
// By: Geoffrey A. Overley
//
// Inputs:1.User selects Countries currency to be converted.
2.User inputs amount of currency.
3.User selects Countries currency to convert to.
//
// Returns:Program will output amount in american dollars,commission in American dollars, and the total amount converted with service fee added.
Also I added color to menu section to help divide and make it more user friendly.
//
//This code is copyrighted and has// limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=3484&lngWId=3//for details.//**************************************

//************************************************************************************************
//	Student Name: Geoffrey A. Overley
// Geoffrey.Overley@uc.edu	
//
//************************************************************************************************
//************************************************************************************************
//	Program Description:
//
//You are required to write a currency exchange program to make conversion of an amount of one 
//currency to another currency. There will be a 3% commission charge.
//
//Read a newspaper's "Business" or "Travel" section, or check out a credible website to find out
//the name of the currency and the exchange rate for the following countries:
//
//	Canada 	Germany
// France Great Britain
// Mexico				Italy
// Switzerland 	Japan
//			US					China
//
//You should document this information on your top documentation area along with the rest of the
//program description: source, date when the source is obtained, and the exchange rates.
//
//Write a C++ program to prompt for the amount and the type of currency to be exchanged from/to 
//the 10 choices listed on top.
//
//Other Requirements:
//
//1.	The date should reflect the current date.
//2.	Center your output on a clean screen.
//3.	Decimal point should be lined up.
//4.	Name of the currency should follow the amounts.
//5.	You must write two complete switch statements to implement the logic.
//
//Your output may look something like this:
//
// Currency Exchange Service
//Mon Oct 22 09:54:29 2001
//
// Amount In : $100.00 (American Dollar) 
// Commission:$3.00 (American Dollar)
// __________________________________
// Amount Out: 113.75 (Canadian Dollar)
//
//In addition to the required documentation on top of your program, you must also provide 
//documentation within the main() function. A group of C++ statements accomplishing certain task 
//should be preceded with a comment statement to document its function. For example:
//
// 	--------Prompt for a Source Currency-------------------------------
//	cout << "Please select a source currency to be exchanged\n";
//cout << "1 for USD \t2 for British Pounds \n3 for Chinese Yen ";
//
// 	 cin >> SourceCurr;
//
// 	--------Make conversion to Swiss Francs---------------------------
// 	 .........................
// 	 .........................
// 	 .........................
// 	 etc.
//
//************************************************************************************************
//************************************************************************************************ 
//
//	Input: Color coded menu system to help user separate sections. User selects which Country and 
// currency to be converted. Once selection is made the next menu prompts user for currency amount
// at which time the program converts to common denominator which is American currency, Then the 
// second currency menu is for user to select which country and currency to convert there previous
// amount into. At this time the program converts and calculates 3% commission.
//
//	Output: The output on the screen is a colorful menu system that helps user navigate and 
// separates each section for easy reading. Also I used system "CLS" to clear information no longer
// needed to clean up look of program and screen. 
// 
//
//	Limitations:At first I couldn't figure out how to line up decimals then I tried using \t tab 
// key function and it seemed to work for what I needed
// Also I was trying to find a way to update from internet site to keep currency rates current.
//
//
//
//************************************************************************************************
#include <windows.h>//for the use of color 
#include <iostream>	//because you need to use cin and cout
#include <stdio.h>
#include <time.h>	//For using time function within program
#include <iomanip> //because I'll show you how to format your output			
#include <math.h>	//Math functions within program
#include <string>
using namespace std;
char option,option2;
int main(void)
{
 time_t rawtime;		//variables defined in TIME.H
 struct tm * timeinfo;
double curinput=0;
double converted=0;
double a,b,c,d,e,f,g,h,i,j;
double commission=0;
double totaltrans=0;
//************************************************************************************************
//*************************Beginning of First Menu section****************************************
//************************************************************************************************
	{	
char option;
	SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 10);// Changing color of text
	cout<<setw(62)<<"_____________________________________________"<<"\n\n";
cout<<setw(61)<<"*** Geoffreys World Currency Convertor ***"<<"\n";
	cout<<setw(62)<<"_____________________________________________"<<"\n\n";
	SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 12);// Changing color of text
	cout<<setw(55)<<"1) Canada currency (Dollar)\n\n";
	cout<<setw(54)<<"2) France currency (Franc)\n\n";
	cout<<setw(53)<<"3) Mexico currency (Peso)\n\n";
	cout<<setw(59)<<"4) Switzerland currency (Franc)\n\n";
	cout<<setw(62)<<"5) United States currency (Dollar)\n\n";
	cout<<setw(54)<<"6) Germany currency (Mark)\n\n";
	cout<<setw(61)<<"7) Great Britain currency (Pound)\n\n";
	cout<<setw(52)<<"8) Italy currency (Lira)\n\n";
	cout<<setw(51)<<"9) Japan currency (Yen)\n\n";
	cout<<setw(52)<<"0) China currency (Yuan)\n\n";
	SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 10);
	cout<<setw(62)<<"_____________________________________________"<<"\n\n";
	cout<<"Please enter your option: ";
	cin>>option;
	system("CLS");
	switch(option)
	{
	case '1':
		SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 13);// Changing color of text
		cout<<"\n\n\n\n\n\n"<<setw(50)<<"Canada currency selected";
		cout<<"\n"<<setw(55)<<"Please enter total Dollar amount:";
		cin>> a;
		curinput=a*.6282;//expression to convert currency to common denominator American currency
		break;
	case '2':
		SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 13);// Changing color of text
		cout<<"\n\n\n\n\n\n"<<setw(50)<<"France currency selected";
		cout<<"\n"<<setw(55)<<"Please enter total Franc amount:";
		cin>> b;
		curinput=b*.1388;//expression to convert currency to common denominator American currency
		break;
	case '3':
		SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 13);// Changing color of text
		cout<<"\n\n\n\n\n\n"<<setw(50)<<"Mexico currency selected";
		cout<<"\n"<<setw(54)<<"Please enter total Peso amount:";
		cin>> c;
		curinput=c*.107933;//expression to convert currency to common denominator American currency
		break;
	case '4':
		SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 13);// Changing color of text
		cout<<"\n\n\n\n\n\n"<<setw(52)<<"Switzerland currency selected";
		cout<<"\n"<<setw(53)<<"Please enter total Franc amount:";
		cin>> d;
		curinput=d*.6179;//expression to convert currency to common denominator American currency
		break;
	case '5':
		SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 13);// Changing color of text
		cout<<"\n\n\n\n\n\n"<<setw(53)<<"United States currency selected";
		cout<<"\n"<<setw(54)<<"Please enter total Dollar amount:";
		cin>> e;
		curinput=e;
		break;
	case '6':
		SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 13);// Changing color of text
		cout<<"\n\n\n\n\n\n"<<setw(50)<<"Germany currency selected";
		cout<<"\n"<<setw(54)<<"Please enter total Mark amount:";
		cin>> f;
		curinput=f*.4654;//expression to convert currency to common denominator American currency
		break;
	case '7':
		SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 13);// Changing color of text
		cout<<"\n\n\n\n\n\n"<<setw(55)<<"Great Britain currency selected";
		cout<<"\n"<<setw(55)<<"Please enter total Pound amount:";
		cin>> g;
		curinput=g*1.4676;//expression to convert currency to common denominator American currency
		break;
	case '8':
		SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 13);// Changing color of text
		cout<<"\n\n\n\n\n\n"<<setw(50)<<"Italy currency selected";
		cout<<"\n"<<setw(54)<<"Please enter total Lira amount:";
		cin>> h;
		curinput=h*.000470;//expression to convert currency to common denominator American currency
		break;
	case '9':
		SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 13);// Changing color of text
		cout<<"\n\n\n\n\n\n"<<setw(52)<<"Japan currency selected";
		cout<<"\n"<<setw(55)<<"Please enter total Yen amount:";
		cin>> i;
		curinput=i*.008222;//expression to convert currency to common denominator American currency
		break;
	case '0':
		SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 13);// Changing color of text
		cout<<"\n\n\n\n\n\n"<<setw(50)<<"China currency selected";
		cout<<"\n"<<setw(55)<<"Please enter total Yuan amount:";
		cin>> j;
		curinput=j*.1208;//expression to convert currency to common denominator American currency
		break;
	default:
		cout<<"Please enter numeric selection according to Country you wish to convert currency too :"<<"\n";
		break;
	}
	}
//************************************************************************************************************
//*************************End of First Menu section**********************************************************
//************************************************************************************************************
//************************************************************************************************************
//*************************Beginning of Second Menu section***************************************************
//************************************************************************************************************
	{
	system("CLS");	
	char option2;
	SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 10);// Changing color of text
	cout<<setw(62)<<"_____________________________________________"<<"\n\n";
cout<<setw(59)<<"*** Convert Selected currency too ***"<<"\n";
	cout<<setw(62)<<"_____________________________________________"<<"\n\n";
	SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 12);// Changing color of text
	cout<<setw(55)<<"1) Canadian currency (Dollar)\n\n";
	cout<<setw(52)<<"2) French currency (Franc)\n\n";
	cout<<setw(52)<<"3) Mexican currency (Peso)\n\n";
	cout<<setw(57)<<"4) Switzerland currency (Franc)\n\n";
	cout<<setw(60)<<"5) United States currency (Dollar)\n\n";
	cout<<setw(51)<<"6) German currency (Mark)\n\n";
	cout<<setw(59)<<"7) Great Britain currency (Pound)\n\n";
	cout<<setw(52)<<"8) Italian currency (Lira)\n\n";
	cout<<setw(52)<<"9) Japanese currency (Yen)\n\n";
	cout<<setw(52)<<"0) Chinese currency (Yuan)\n\n";
	SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 10);
	cout<<setw(62)<<"_____________________________________________"<<"\n\n";
	cout<<"Please enter your option: ";
	cin>>option2;
	
	system("CLS");
	switch(option2)
	{
	case '1':
		SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 13);// Changing color of text
		cout<<"\n\n\n\n\n\n"<<setw(49)<<"Canadian currency selected"<<"\n\n";
		commission=curinput*.03;//expression to calculate 3% commission
		commission=commission*pow(10,2);		//This statemment is used to round off figure.***************
		commission=commission+0.5;
		commission=floor(commission);
		commission=commission/pow(10,2);
		totaltrans=commission+curinput;//This statement adds commission and menu1 currency in American dollars
		converted=totaltrans/.6282;
		converted=converted*pow(10,2);		//This statemment is used to round off figure.*******************
		converted=converted+0.5;
		converted=floor(converted);
		converted=converted/pow(10,2);
		cout<<"\n"<<setw(53)<<"Geoffreys Currency Exchange Service"<<"\n\n\n";
		time ( &rawtime );//These following statements acquire computer date and time to display in output
		timeinfo = localtime ( &rawtime );
		printf( "Current date and time are: %s", asctime (timeinfo) );
		curinput=curinput*pow(10,2);		//This statemment is used to round off figure.*******************
		curinput=curinput+0.5;
		curinput=floor(curinput);
		curinput=curinput/pow(10,2);
		cout<<"\n"<<"\t\t"<<"Amount in:"<<"\t"<<curinput<<"\t"<<"(American Dollar)"<<"\n";
		cout<<"\n"<<"\t\t"<<"Commission:"<<"\t"<<commission<<"\t"<<"(American Dollar)"<<"\n";
		cout<<"\n"<<"\t\t"<<"Total:"<<"\t\t"<<converted<<"\t"<<"(Canadian Dollar)"<<"\n\n"<<endl;
		break;
	case '2':
		SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 13);// Changing color of text
		cout<<"\n\n\n\n\n\n"<<setw(49)<<"French currency selected"<<"\n\n";
		commission=curinput*.03;//expression to calculate 3% commission
		commission=commission*pow(10,2);		//This statemment is used to round off figure.***************
		commission=commission+0.5;
		commission=floor(commission);
		commission=commission/pow(10,2);
		totaltrans=commission+curinput;//This statement adds commission and menu1 currency in American dollars
		converted=totaltrans/.1388;
		converted=converted*pow(10,2);		//This statemment is used to round off figure.*******************
		converted=converted+0.5;
		converted=floor(converted);
		converted=converted/pow(10,2);
		cout<<"\n"<<setw(52)<<"Geoffreys Currency Exchange Service"<<"\n\n\n";
		time ( &rawtime );//These following statements acquire computer date and time to display in output
		timeinfo = localtime ( &rawtime );
		printf ( "Current date and time are: %s", asctime (timeinfo) );
		curinput=curinput*pow(10,2);		//This statemment is used to round off figure.*******************
		curinput=curinput+0.5;
		curinput=floor(curinput);
		curinput=curinput/pow(10,2);
		cout<<"\n"<<"\t\t"<<"Amount in:"<<"\t"<<curinput<<"\t"<<"(American Dollar)"<<"\n";
		cout<<"\n"<<"\t\t"<<"Commission:"<<"\t"<<commission<<"\t"<<"(American Dollar)"<<"\n";
		cout<<"\n"<<"\t\t"<<"Total:"<<"\t\t"<<converted<<"\t"<<"(French Franc)"<<"\n\n"<<endl;
		break;
	case '3':
		SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 13);// Changing color of text
		cout<<"\n\n\n\n\n\n"<<setw(49)<<"Mexican currency selected"<<"\n\n";
		commission=curinput*.03;//expression to calculate 3% commission
		commission=commission*pow(10,2);		//This statemment is used to round off figure.***************
		commission=commission+0.5;
		commission=floor(commission);
		commission=commission/pow(10,2);
		totaltrans=commission+curinput;//This statement adds commission and menu1 currency in American dollars
		converted=totaltrans/.107933;
		converted=converted*pow(10,2);		//This statemment is used to round off figure.*******************
		converted=converted+0.5;
		converted=floor(converted);
		converted=converted/pow(10,2);
		cout<<"\n"<<setw(52)<<"Geoffreys Currency Exchange Service"<<"\n\n\n";
		time ( &rawtime );//These following statements acquire computer date and time to display in output
		timeinfo = localtime ( &rawtime );
		printf ( "Current date and time are: %s", asctime (timeinfo) );
		curinput=curinput*pow(10,2);		//This statemment is used to round off figure.*******************
		curinput=curinput+0.5;
		curinput=floor(curinput);
		curinput=curinput/pow(10,2);
		cout<<"\n"<<"\t\t"<<"Amount in:"<<"\t"<<curinput<<"\t"<<"(American Dollar)"<<"\n";
		cout<<"\n"<<"\t\t"<<"Commission:"<<"\t"<<commission<<"\t"<<"(American Dollar)"<<"\n";
		cout<<"\n"<<"\t\t"<<"Total:"<<"\t\t"<<converted<<"\t"<<"(Mexican Peso)"<<"\n\n"<<endl;
		break;
	case '4':
		SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 13);// Changing color of text
		cout<<"\n\n\n\n\n\n"<<setw(49)<<"Switzerland currency selected"<<"\n\n";
		commission=curinput*.03;//expression to calculate 3% commission
		commission=commission*pow(10,2);		//This statemment is used to round off figure.***************
		commission=commission+0.5;
		commission=floor(commission);
		commission=commission/pow(10,2);
		totaltrans=commission+curinput;//This statement adds commission and menu1 currency in American dollars
		converted=totaltrans/.6179;
		converted=converted*pow(10,2);		//This statemment is used to round off figure.*******************
		converted=converted+0.5;
		converted=floor(converted);
		converted=converted/pow(10,2);
		cout<<"\n"<<setw(52)<<"Geoffreys Currency Exchange Service"<<"\n\n\n";
		time ( &rawtime );//These following statements acquire computer date and time to display in output
		timeinfo = localtime ( &rawtime );
		printf ( "Current date and time are: %s", asctime (timeinfo) );
		curinput=curinput*pow(10,2);		//This statemment is used to round off figure.*******************
		curinput=curinput+0.5;
		curinput=floor(curinput);
		curinput=curinput/pow(10,2);
		cout<<"\n"<<"\t\t"<<"Amount in:"<<"\t"<<curinput<<"\t"<<"(American Dollar)"<<"\n";
		cout<<"\n"<<"\t\t"<<"Commission:"<<"\t"<<commission<<"\t"<<"(American Dollar)"<<"\n";
		cout<<"\n"<<"\t\t"<<"Total:"<<"\t\t"<<converted<<"\t"<<"(Switzerland Franc)"<<"\n\n"<<endl;
		break;
	case '5':
		SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 13);// Changing color of text
		cout<<"\n\n\n\n\n\n"<<setw(49)<<"American currency selected"<<"\n\n";
		commission=curinput*.03;//expression to calculate 3% commission
		commission=commission*pow(10,2);		//This statemment is used to round off figure.**************
		commission=commission+0.5;
		commission=floor(commission);
		commission=commission/pow(10,2);
		totaltrans=commission+curinput;//This statement adds commission and menu1 currency in American dollars
		converted=totaltrans;
		converted=converted*pow(10,2);		//This statemment is used to round off figure.******************
		converted=converted+0.5;
		converted=floor(converted);
		converted=converted/pow(10,2);
		cout<<"\n"<<setw(52)<<"Geoffreys Currency Exchange Service"<<"\n\n\n";
		time ( &rawtime );//These following statements acquire computer date and time to display in output
		timeinfo = localtime ( &rawtime );
		printf ( "Current date and time are: %s", asctime (timeinfo) );
		curinput=curinput*pow(10,2);		//This statemment is used to round off figure.******************
		curinput=curinput+0.5;
		curinput=floor(curinput);
		curinput=curinput/pow(10,2);
		cout<<"\n"<<"\t\t"<<"Amount in:"<<"\t"<<curinput<<"\t"<<"(American Dollar)"<<"\n";
		cout<<"\n"<<"\t\t"<<"Commission:"<<"\t"<<commission<<"\t"<<"(American Dollar)"<<"\n";
		cout<<"\n"<<"\t\t"<<"Total:"<<"\t\t"<<converted<<"\t"<<"(American Dollar)"<<"\n\n"<<endl;
		break;
	case '6':
		SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 13);// Changing color of text
		cout<<"\n\n\n\n\n\n"<<setw(49)<<"German currency selected"<<"\n\n";
		commission=curinput*.03;//expression to calculate 3% commission
		commission=commission*pow(10,2);		//This statemment is used to round off figure.**************
		commission=commission+0.5;
		commission=floor(commission);
		commission=commission/pow(10,2);
		totaltrans=commission+curinput;//This statement adds commission and menu1 currency in American dollars
		converted=totaltrans/.4654;
		converted=converted*pow(10,2);		//This statemment is used to round off figure.******************
		converted=converted+0.5;
		converted=floor(converted);
		converted=converted/pow(10,2);
		cout<<"\n"<<setw(52)<<"Geoffreys Currency Exchange Service"<<"\n\n\n";
		time ( &rawtime );//These following statements acquire computer date and time to display in output
		timeinfo = localtime ( &rawtime );
		printf ( "Current date and time are: %s", asctime (timeinfo) );
		curinput=curinput*pow(10,2);		//This statemment is used to round off figure.******************
		curinput=curinput+0.5;
		curinput=floor(curinput);
		curinput=curinput/pow(10,2);
		cout<<"\n"<<"\t\t"<<"Amount in:"<<"\t"<<curinput<<"\t"<<"(American Dollar)"<<"\n";
		cout<<"\n"<<"\t\t"<<"Commission:"<<"\t"<<commission<<"\t"<<"(American Dollar)"<<"\n";
		cout<<"\n"<<"\t\t"<<"Total:"<<"\t\t"<<converted<<"\t"<<"(German Mark)"<<"\n\n"<<endl;
		break;
	case '7':
		SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 13);// Changing color of text
		cout<<"\n\n\n\n\n\n"<<setw(49)<<"Great Britain currency selected"<<"\n\n";
		commission=curinput*.03;//expression to calculate 3% commission
		commission=commission*pow(10,2);		//This statemment is used to round off figure.**************
		commission=commission+0.5;
		commission=floor(commission);
		commission=commission/pow(10,2);
		totaltrans=commission+curinput;//This statement adds commission and menu1 currency in American dollars
		converted=totaltrans/1.4676;
		converted=converted*pow(10,2);		//This statemment is used to round off figure.******************
		converted=converted+0.5;
		converted=floor(converted);
		converted=converted/pow(10,2);
		cout<<"\n"<<setw(52)<<"Geoffreys Currency Exchange Service"<<"\n\n\n";
		time ( &rawtime );//These following statements acquire computer date and time to display in output
		timeinfo = localtime ( &rawtime );
		printf ( "Current date and time are: %s", asctime (timeinfo) );
		curinput=curinput*pow(10,2);		//This statemment is used to round off figure.******************
		curinput=curinput+0.5;
		curinput=floor(curinput);
		curinput=curinput/pow(10,2);
		cout<<"\n"<<"\t\t"<<"Amount in:"<<"\t"<<curinput<<"\t"<<"(American Dollar)"<<"\n";
		cout<<"\n"<<"\t\t"<<"Commission:"<<"\t"<<commission<<"\t"<<"(American Dollar)"<<"\n";
		cout<<"\n"<<"\t\t"<<"Total:"<<"\t\t"<<converted<<"\t"<<"(British Pound)"<<"\n\n"<<endl;
		break;
	case '8':
		SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 13);// Changing color of text
		cout<<"\n\n\n\n\n\n"<<setw(49)<<"Italian currency selected"<<"\n\n";
		commission=curinput*.03;//expression to calculate 3% commission
		commission=commission*pow(10,2);		//This statemment is used to round off figure.**************
		commission=commission+0.5;
		commission=floor(commission);
		commission=commission/pow(10,2);
		totaltrans=commission+curinput;//This statement adds commission and menu1 currency in American dollars
		converted=totaltrans/.000470;
		converted=converted*pow(10,2);		//This statemment is used to round off figure.******************
		converted=converted+0.5;
		converted=floor(converted);
		converted=converted/pow(10,2);
		cout<<"\n"<<setw(52)<<"Geoffreys Currency Exchange Service"<<"\n\n\n";
		time ( &rawtime );//These following statements acquire computer date and time to display in output
		timeinfo = localtime ( &rawtime );
		printf ( "Current date and time are: %s", asctime (timeinfo) );
		curinput=curinput*pow(10,2);		//This statemment is used to round off figure.******************
		curinput=curinput+0.5;
		curinput=floor(curinput);
		curinput=curinput/pow(10,2);
		cout<<"\n"<<"\t\t"<<"Amount in:"<<"\t"<<curinput<<"\t"<<"(American Dollar)"<<"\n";
		cout<<"\n"<<"\t\t"<<"Commission:"<<"\t"<<commission<<"\t"<<"(American Dollar)"<<"\n";
		cout<<"\n"<<"\t\t"<<"Total:"<<"\t\t"<<converted<<"\t"<<"(Italian Lira)"<<"\n\n"<<endl;
		break;
	case '9':
		SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 13);// Changing color of text
		cout<<"\n\n\n\n\n\n"<<setw(49)<<"Japanese currency selected"<<"\n\n";
		commission=curinput*.03;//expression to calculate 3% commission
		commission=commission*pow(10,2);		//This statemment is used to round off figure.**************
		commission=commission+0.5;
		commission=floor(commission);
		commission=commission/pow(10,2);
		totaltrans=commission+curinput;//This statement adds commission and menu1 currency in American dollars
		converted=totaltrans/.008222;
		converted=converted*pow(10,2);		//This statemment is used to round off figure.******************
		converted=converted+0.5;
		converted=floor(converted);
		converted=converted/pow(10,2);
		cout<<"\n"<<setw(52)<<"Geoffreys Currency Exchange Service"<<"\n\n\n";
		time ( &rawtime );//These following statements acquire computer date and time to display in output
		timeinfo = localtime ( &rawtime );
		printf ( "Current date and time are: %s", asctime (timeinfo) );
		curinput=curinput*pow(10,2);		//This statemment is used to round off figure.******************
		curinput=curinput+0.5;
		curinput=floor(curinput);
		curinput=curinput/pow(10,2);
		cout<<"\n"<<"\t\t"<<"Amount in:"<<"\t"<<curinput<<"\t"<<"(American Dollar)"<<"\n";
		cout<<"\n"<<"\t\t"<<"Commission:"<<"\t"<<commission<<"\t"<<"(American Dollar)"<<"\n";
		cout<<"\n"<<"\t\t"<<"Total:"<<"\t\t"<<converted<<"\t"<<"(Japanese Yen)"<<"\n\n"<<endl;
		break;
	case '0':
		SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 13);// Changing color of text
		cout<<"\n\n\n\n\n\n"<<setw(49)<<"Chinese currency selected"<<"\n\n";
		commission=curinput*.03;//expression to calculate 3% commission
		commission=commission*pow(10,2);		//This statemment is used to round off figure.**************
		commission=commission+0.5;
		commission=floor(commission);
		commission=commission/pow(10,2);
		totaltrans=commission+curinput;//This statement adds commission and menu1 currency in American dollars
		converted=totaltrans/.1208;
		converted=converted*pow(10,2);		//This statemment is used to round off figure.******************
		converted=converted+0.5;
		converted=floor(converted);
		converted=converted/pow(10,2);
		cout<<"\n"<<setw(52)<<"Geoffreys Currency Exchange Service"<<"\n\n\n";
		time ( &rawtime );//These following statements acquire computer date and time to display in output
		timeinfo = localtime ( &rawtime );
		printf ( "Current date and time are: %s", asctime (timeinfo) );
		curinput=curinput*pow(10,2);		//This statemment is used to round off figure.******************
		curinput=curinput+0.5;
		curinput=floor(curinput);
		curinput=curinput/pow(10,2);
		cout<<"\n"<<"\t\t"<<"Amount in:"<<"\t"<<curinput<<"\t"<<"(American Dollar)"<<"\n";
		cout<<"\n"<<"\t\t"<<"Commission:"<<"\t"<<commission<<"\t"<<"(American Dollar)"<<"\n";
		cout<<"\n"<<"\t\t"<<"Total:"<<"\t\t"<<converted<<"\t"<<"(Chinese Yuan)"<<"\n\n"<<endl;
		break;
	default:
		cout<<"Please enter numeric selection according to Country and currency desired \n";
		break;
	}
	
	}
//*********************************************************************************************************
//*************************End of Second Menu section******************************************************
//*********************************************************************************************************
return 0;
}


Other 1 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.