亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? currency.cpp

?? 計算器 英國一個學(xué)生寫的 代碼很適合學(xué)習(xí)
?? CPP
字號:
//////////////////////////////////////////////////////////////////////
/*							  Currency.cpp							*/
/*				implementation for the Currency class				*/
/*							  written by							*/
/*							Anwar-ul-Haque							*/
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "Currency Calculator.h"
#include "Currency.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif


//////////////////////////////////////////////////////////////////////
// Static data definiation
//////////////////////////////////////////////////////////////////////

double Currency::currency_rates[MAX_COUNTRIES][MAX_COUNTRIES];

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

Currency::Currency()
{
	notes = 0;
	coins = 0;
	c_letter = "";
	operation_flag = false;
}

Currency::Currency( ULONG note )
{
	notes = note;
	coins = 0;
	set_c_letter( DEFAULT_COUNTRY );
	operation_flag = false;
}

Currency::Currency( ULONG note, WORD coin, CString letter )
{
	notes = note + coin / 100;
	coins = coin % 100;
	c_letter = letter;
	operation_flag = false;
}

Currency::Currency( double amount, CString letter )
{
	if( amount<0 )
	{
		::AfxMessageBox( "Negative currencies are not allowed..." );
		return;
	}
	notes = ULONG (amount);
	coins = WORD ((amount - notes) * 100);
	c_letter = letter;
	operation_flag = false;
}

//////////////////////////////////////////////////////////////////////
// Set & Get Functions
//////////////////////////////////////////////////////////////////////

void Currency::set_currency( ULONG note, WORD coin, CString letter)
{
	notes = note + coin / 100;
	coins = coin % 100;
	c_letter = letter;
}

void Currency::set_currency( Currency amount )
{
	notes = amount.notes;
	coins = amount.coins;
	c_letter = amount.c_letter;
}

void Currency::set_currency( double amount, CString letter )
{
	notes = ULONG (amount);
	coins = WORD ((amount-notes) * 100.0);
	c_letter = letter;
}

void Currency::set_notes( ULONG note )
{
	notes = note;
}

void Currency::set_coins( WORD coin )
{
	coins = coin;
}

void Currency::set_c_letter( CString letter )
{
	c_letter = letter;
}

void Currency::set_c_letter( cname country )
{
	BOOL found = false;
	for( int i=0; i<MAX_COUNTRIES; i++ )
		if( country==COUNTRIES[i] )
		{
			found = true;
			break;
		}
	if( found )
		c_letter = CURR_LETTERS[i];
	else
		TRACE( "Error: Undefined Currency Letter..." );
}

Currency Currency::get_currency()
{
	return Currency( notes, coins, c_letter );
}

ULONG Currency::get_notes()
{
	return notes;
}

WORD Currency::get_coins()
{
	return coins;
}

CString Currency::get_c_letter()
{
	return c_letter;
}

double Currency::get_double()
{
	double amount = double(coins)/100;
	amount +=  double(notes);
	return amount;
}

//////////////////////////////////////////////////////////////////////
// Overloaded Operators
//////////////////////////////////////////////////////////////////////

Currency Currency::operator + ( Currency amount )
{
	Currency temp;
	if( strcmp(c_letter, amount.c_letter) )
	{
		::AfxMessageBox( "Can not add amounts of two different currencies..." );
		operation_flag = false;
		return temp;
	}
	temp.coins = coins + amount.coins;
	if( temp.coins>=100 )
	{
		temp.notes++;
		temp.coins -= 100;
	}
	temp.notes += notes + amount.notes;
	temp.c_letter = c_letter;
	operation_flag = true;
	return temp;
}

Currency Currency::operator + ( double amount )
{
	Currency temp;
	ULONG note = ULONG (amount);
	WORD coin = WORD ((amount-note) * 100.0);
	temp.coins = coins + coin;
	if( temp.coins>=100 )
	{
		temp.notes++;
		temp.coins -= 100;
	}
	temp.notes += notes + note;
	temp.c_letter = c_letter;
	operation_flag = true;
	return temp;
}

void Currency::operator += ( Currency amount )
{
	if( strcmp(c_letter, amount.c_letter) )
	{
		::AfxMessageBox( "Can not add amounts of two different currencies..." );
		operation_flag = false;
		return;
	}
	coins += amount.coins;
	if( coins>=100 )
	{
		notes++;
		coins -= 100;
	}
	notes += amount.notes;
	operation_flag = true;
}

void Currency::operator += ( double amount )
{
	ULONG note = ULONG (amount);
	WORD coin = WORD ((amount-note) * 100.0);
	coins += coin;
	if( coins>=100 )
	{
		notes++;
		coins -= 100;
	}
	notes += note;
	operation_flag = true;
}

Currency Currency::operator - ( Currency amount )
{
	Currency temp;
	if( strcmp(c_letter, amount.c_letter) )
	{
		::AfxMessageBox( "Can not subtract amounts of two different currencies..." );
		operation_flag = false;
		return temp;
	}
	if( notes<amount.notes )
	{
		::AfxMessageBox( "Can not subtract higher amount from lower amount..." );
		operation_flag = false;
		return temp;
	}
	int temp_c = coins - amount.coins;
	BOOL flag = false;
	if( temp_c<0 )
	{
		flag = true;
		temp.coins = temp_c + 100;
	}
	else
		temp.coins = temp_c;
	temp.notes = notes - amount.notes;
	if( flag )
		temp.notes--;
	temp.c_letter = c_letter;
	operation_flag = true;
	return temp;
}

Currency Currency::operator - ( double amount )
{
	Currency temp;
	ULONG note = ULONG (amount);
	WORD coin = WORD ((amount-note) * 100.0);
	if( notes<note )
	{
		::AfxMessageBox( "Can not subtract higher amount from lower amount..." );
		operation_flag = false;
		return temp;
	}
	int temp_c = coins - coin;
	BOOL flag = false;
	if( temp_c<0 )
	{
		flag = true;
		temp.coins = temp_c + 100;
	}
	else
		temp.coins = temp_c;
	temp.notes = notes - note;
	if( flag )
		temp.notes--;
	temp.c_letter = c_letter;
	operation_flag = true;
	return temp;
}

void Currency::operator -= ( Currency amount )
{
	if( strcmp(c_letter, amount.c_letter) )
	{
		::AfxMessageBox( "Can not subtract amounts of two different currencies..." );
		operation_flag = false;
		return;
	}
	if( notes<amount.notes )
	{
		::AfxMessageBox( "Can not subtract higher amount from lower amount..." );
		operation_flag = false;
		return;
	}
	int temp = coins-amount.coins;
	coins = temp;
	if( temp<0 )
	{
		notes--;
		coins += 100;
	}
	notes -= amount.notes;
	operation_flag = true;
}

void Currency::operator -= ( double amount )
{
	ULONG note = ULONG (amount);
	WORD coin = WORD ((amount-note) * 100.0);
	if( notes<note )
	{
		::AfxMessageBox( "Can not subtract higher amount from lower amount..." );
		operation_flag = false;
		return;
	}
	int temp = coins-coin;
	coins = temp;
	if( temp<0 )
	{
		notes--;
		coins += 100;
	}
	notes -= note;
	operation_flag = true;
}

Currency Currency::operator * ( double number )
{
	Currency temp;
	if( number<0 )
	{
		::AfxMessageBox( "Multiplication by negative number is not allowed..." );
		operation_flag = false;
		return temp;
	}
	double amount = double (notes + double (coins) / 100);
	amount *= number;
	temp.notes = ULONG (amount);
	temp.coins = WORD ((amount-temp.notes) * 100.0);
	temp.c_letter = c_letter;
	operation_flag = true;
	return temp;
}

void Currency::operator *= ( double number )
{
	if( number<0 )
	{
		::AfxMessageBox( "Multiplication by negative number is not allowed..." );
		operation_flag = false;
		return;
	}
	double amount = double (notes + double (coins) / 100);
	amount *= number;
	notes = ULONG (amount);
	coins = WORD ((amount-notes) * 100.0);
	operation_flag = true;
}

Currency Currency::operator / ( double number )
{
	Currency temp;
	if( number==0 )
	{
		::AfxMessageBox( "Can not divide by zero..." );
		operation_flag = false;
		return temp;
	}
	if( number<0 )
	{
		::AfxMessageBox( "Division by negative number is not allowed..." );
		operation_flag = false;
		return temp;
	}
	double amount = double (notes + double (coins) / 100);
	amount /= number;
	temp.notes = ULONG (amount);
	temp.coins = WORD ((amount-temp.notes) * 100.0);
	temp.c_letter = c_letter;
	operation_flag = true;
	return temp;
}

void Currency::operator /= ( double number )
{
	if( number==0 )
	{
		::AfxMessageBox( "Can not divide by zero..." );
		operation_flag = false;
		return;
	}
	if( number<0 )
	{
		::AfxMessageBox( "Division by negative number is not allowed..." );
		operation_flag = false;
		return;
	}
	double amount = double (notes + double (coins) / 100);
	amount /= number;
	notes = ULONG (amount);
	coins = WORD ((amount-notes) * 100.0);
	operation_flag = true;
}

Currency Currency::operator % ( double per )
{
	Currency temp;
	if( per<0 )
	{
		::AfxMessageBox( "Percentage on the base of negative values is not allowed..." );
		operation_flag = false;
		return temp;
	}
	double amount = double (notes + double (coins) / 100);
	amount *= (per / 100.0);
	temp.notes = ULONG (amount);
	temp.coins = WORD ((amount-temp.notes) * 100.0);
	temp.c_letter = c_letter;
	operation_flag = true;
	return temp;
}

void Currency::operator %= ( double per )
{
	if( per<0 )
	{
		::AfxMessageBox( "Percentage on the base of negative values is not allowed..." );
		operation_flag = false;
		return;
	}
	double amount = double (notes + double (coins) / 100);
	amount *= (per / 100.0);
	notes = ULONG (amount);
	coins = WORD ((amount-notes) * 100.0);
	operation_flag = true;
}

//////////////////////////////////////////////////////////////////////
// Overloaded Comparison Operators
// Note: Deviation of 

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产美女在线观看一区| 91高清视频在线| 国产麻豆日韩欧美久久| 成人一区二区三区| 色哟哟一区二区三区| 欧美视频精品在线观看| 精品剧情v国产在线观看在线| 日本一区二区三区免费乱视频| 亚洲欧美激情在线| 欧美日韩一级视频| 日韩手机在线导航| 一区二区三区在线免费| 国产一区日韩二区欧美三区| 99久久夜色精品国产网站| 555夜色666亚洲国产免| 亚洲欧洲日韩综合一区二区| 日韩精品1区2区3区| 成人性视频免费网站| 日韩精品一区在线观看| 一区二区欧美视频| 91丨九色丨国产丨porny| 久久综合九色综合97_久久久| 天天射综合影视| 欧美调教femdomvk| 亚洲福利视频一区二区| 欧美图区在线视频| 性欧美大战久久久久久久久| 色噜噜狠狠色综合欧洲selulu| 国产精品久久久久久久久免费桃花 | 成人丝袜高跟foot| 国产精品日韩成人| 成人激情av网| 亚洲日本乱码在线观看| 91国偷自产一区二区使用方法| 亚洲天堂中文字幕| 欧美日韩色综合| 国产在线乱码一区二区三区| 国产日韩影视精品| 91美女片黄在线| 久久er99精品| 亚洲蜜臀av乱码久久精品蜜桃| 欧美日韩精品免费| 国产高清亚洲一区| 日韩精品一区第一页| 国产午夜精品一区二区| 91精品国产综合久久久久久久久久 | 99re这里只有精品首页| 日韩一区精品字幕| 日韩久久一区二区| 26uuu色噜噜精品一区| 91福利区一区二区三区| 国产乱妇无码大片在线观看| 一区二区三区在线观看视频| 久久久久久久久久久久电影| 欧美性大战久久久| 99国内精品久久| www.日韩精品| 色婷婷国产精品| av电影一区二区| 91伊人久久大香线蕉| jiyouzz国产精品久久| 成人丝袜高跟foot| 丁香另类激情小说| 一本一道久久a久久精品综合蜜臀| 精品一区免费av| 国产一区在线精品| 成人精品视频.| 在线观看91视频| 欧美日韩一区二区在线观看视频| 日本道精品一区二区三区| 91黄视频在线观看| 欧美丰满少妇xxxbbb| 久久综合九色综合欧美就去吻| 日韩一区二区三区高清免费看看| 欧美人妇做爰xxxⅹ性高电影 | 欧洲国内综合视频| 91精品在线观看入口| 欧美一二三四区在线| 欧美激情在线一区二区| 亚洲欧美日韩精品久久久久| 三级久久三级久久| 99精品久久久久久| 日韩精品一区二区在线观看| 国产精品五月天| 日本成人在线视频网站| 成人网在线播放| 欧美mv日韩mv亚洲| 一区二区三区中文在线| 国产精品一级二级三级| 正在播放亚洲一区| 亚洲最大成人网4388xx| 成人久久18免费网站麻豆| 欧美日韩dvd在线观看| 最新久久zyz资源站| 国产69精品一区二区亚洲孕妇| 欧美日韩在线播放三区四区| 中文字幕亚洲欧美在线不卡| 国产很黄免费观看久久| 欧美草草影院在线视频| 亚洲成人午夜影院| 3751色影院一区二区三区| 一区二区三区在线免费播放| 成人高清免费在线播放| 日本一区二区免费在线观看视频| 国产综合一区二区| 精品国产91久久久久久久妲己| 天堂av在线一区| 日韩精品一区二区三区在线播放| 日韩国产欧美视频| 久久综合久久综合久久综合| 国产99精品在线观看| 国产精品乱子久久久久| 91精品福利视频| 老司机免费视频一区二区| 国产日韩一级二级三级| 91福利视频在线| 国产伦精品一区二区三区免费| 亚洲国产岛国毛片在线| 欧美亚洲综合在线| 国产成人午夜视频| 天堂蜜桃91精品| 亚洲午夜影视影院在线观看| 日韩久久免费av| 99久久婷婷国产综合精品| 夜夜精品浪潮av一区二区三区| 色狠狠一区二区| 日韩va欧美va亚洲va久久| 久久先锋影音av| 一本久久a久久精品亚洲| 亚洲尤物视频在线| 久久久久久久免费视频了| 99re热这里只有精品免费视频| 一区二区三区精品视频| 欧美一级片在线看| 一本色道a无线码一区v| 激情六月婷婷久久| 亚洲已满18点击进入久久| 久久久午夜精品| 欧美日韩美少妇| 成人h版在线观看| 国内精品免费**视频| 亚洲成精国产精品女| 国产精品电影一区二区| 久久久久久综合| 国产亚洲精品久| 欧美成人艳星乳罩| 9191久久久久久久久久久| 91福利国产成人精品照片| 大尺度一区二区| 成人激情文学综合网| 成人夜色视频网站在线观看| 国产精品一区三区| 国产精品亚洲一区二区三区在线 | 国产欧美精品国产国产专区| 91精品国产欧美日韩| 欧美蜜桃一区二区三区| 精品婷婷伊人一区三区三| 在线亚洲+欧美+日本专区| 在线观看日韩一区| 欧美军同video69gay| 欧美成人精品1314www| 久久精品综合网| 一区二区三区四区五区视频在线观看 | 亚洲国产裸拍裸体视频在线观看乱了| 亚洲视频一区二区免费在线观看| 中文字幕av不卡| 亚洲国产精品精华液网站| 丝袜诱惑制服诱惑色一区在线观看| 精品一区二区av| 欧美日韩精品福利| 久久蜜桃香蕉精品一区二区三区| 国产精品毛片久久久久久 | 欧美日韩国产中文| 精品国产乱码久久久久久免费 | www.亚洲免费av| 欧美大片一区二区三区| 亚洲欧美日韩国产成人精品影院 | 欧美三级电影网| 中文字幕一区二区三区色视频| 亚洲一区精品在线| caoporn国产精品| 久久久美女毛片| 精品一区中文字幕| 日韩一区二区三区观看| 亚洲精品欧美激情| 99re视频精品| 亚洲影视资源网| 在线观看av一区二区| 亚洲午夜国产一区99re久久| 91福利视频在线| 亚洲国产日产av| 日韩一级欧美一级| 狠狠色综合播放一区二区| 欧美成人女星排行榜| 麻豆精品蜜桃视频网站| 国产精品黄色在线观看| 一本一道久久a久久精品综合蜜臀| 亚洲色图另类专区| 欧美日韩高清在线| 狠狠色综合播放一区二区|