文件名称:RMB
介绍说明--下载内容均来自于网络,请自行研究使用
一、设计人民币类,数据成员包含正负标志位、元、角、分 ,设计构造函数、输出函数、重载+、-、前置自增、后置自增、前置自减、后置自减、输出流插入运算符<<、输入流提取运算符>> . 其中前置自减、后置自减、<<和>>重载成友元函数。
自增表示增加1分钱。自减表示减少1分钱。加减法和构造时的进位要考虑。
编写主函数测试之。
功能说明:
1. 所有的人民币的输出和输出都要使用重载的运算符<<和>>
2. 所有的单目运算符的操作都是针对第一个人民币
3. (+m元n角k分),表示m、n、k都是正值;
(-m元n角k分),表示m、n、k都是负值。负的人民币值表示赤字。
0元0角0分用+表示
-First, the design yuan classes, data members contains positive and negative signs, dollars, and cents, the design constructor, output function, the overloaded+,-, pre-increment, post-increment, pre-decrement, post-decrement, the output stream insertion operator << input stream extraction operator >>. which pre-decrement, post-decrement, << and >> overloaded as friend function.
Increment represents an increase of 1 cent. Decrement, reduced by 1 cent. Binary addition and subtraction and constructed to consider.
Write the main function testing.
Function:
A. Output and output of RMB must use the overloaded operator << and >>
Two. All unary operator operating for one yuan
(+ M-ary n-angle k points), indicating that m, n, k are positive
(-M-ary n-angle k), m, n, k are negative. Negative value of the yuan, said the deficit.
$ 0 0 angle 0+ denote
自增表示增加1分钱。自减表示减少1分钱。加减法和构造时的进位要考虑。
编写主函数测试之。
功能说明:
1. 所有的人民币的输出和输出都要使用重载的运算符<<和>>
2. 所有的单目运算符的操作都是针对第一个人民币
3. (+m元n角k分),表示m、n、k都是正值;
(-m元n角k分),表示m、n、k都是负值。负的人民币值表示赤字。
0元0角0分用+表示
-First, the design yuan classes, data members contains positive and negative signs, dollars, and cents, the design constructor, output function, the overloaded+,-, pre-increment, post-increment, pre-decrement, post-decrement, the output stream insertion operator << input stream extraction operator >>. which pre-decrement, post-decrement, << and >> overloaded as friend function.
Increment represents an increase of 1 cent. Decrement, reduced by 1 cent. Binary addition and subtraction and constructed to consider.
Write the main function testing.
Function:
A. Output and output of RMB must use the overloaded operator << and >>
Two. All unary operator operating for one yuan
(+ M-ary n-angle k points), indicating that m, n, k are positive
(-M-ary n-angle k), m, n, k are negative. Negative value of the yuan, said the deficit.
$ 0 0 angle 0+ denote
(系统自动生成,下载前可以参看下载内容)
下载文件列表
作业9 运算符重载.cpp