文件名称:4
下载
别用迅雷、360浏览器下载。
如迅雷强制弹出,可右键点击选“另存为”。
失败请重下,重下不扣分。
如迅雷强制弹出,可右键点击选“另存为”。
失败请重下,重下不扣分。
介绍说明--下载内容均来自于网络,请自行研究使用
1、定义一个复数类,要求包括
i、无参构造函数,初始化实部和虚部均为0
ii、有参构造函数,通过参数初始化实部和虚部
iii、输出复数的成员函数
iv、以成员函数的方式重载复数加法
v、以友元的方式重载复数加法
2、三维数据型如a+bi+cj(其中abc为实数),加法法则为
(a1+b1i+c1j)+(a2+b2i+c2j)=(a1+a2)+(b1+b2)i+(c1+c2)j
要求
i、以题目1的复数为基础,采用继承的方式构造三维数据类(包括无参和有参构造函数)
ii、以成员函数的方式重载三维数据加法
iii、以友元的方式重载三维数据加法
-1, the definition of a complex class requirements include i no-argument constructor, initialize the real and imaginary parts are 0 ii, arg constructor, the real and imaginary parts of the parameter initialization iii output plural members the function iv member function overloaded complex addition v overloaded complex addition, three-dimensional data type, such as a+bi+cj (where abc is a real number), the addition rule for (a1+b1i+c1j)+ (a2+b2i+c2j) = (a1+a2 to a friend )+ (b1+b2) i+ (c1+c2) j requires i, based topic plural, using inheritance to construct 3D data classes (including parameters and parameter constructor) ii way overloaded member function of the three-dimensional data Addition iii friend way overloaded three-dimensional data addition
i、无参构造函数,初始化实部和虚部均为0
ii、有参构造函数,通过参数初始化实部和虚部
iii、输出复数的成员函数
iv、以成员函数的方式重载复数加法
v、以友元的方式重载复数加法
2、三维数据型如a+bi+cj(其中abc为实数),加法法则为
(a1+b1i+c1j)+(a2+b2i+c2j)=(a1+a2)+(b1+b2)i+(c1+c2)j
要求
i、以题目1的复数为基础,采用继承的方式构造三维数据类(包括无参和有参构造函数)
ii、以成员函数的方式重载三维数据加法
iii、以友元的方式重载三维数据加法
-1, the definition of a complex class requirements include i no-argument constructor, initialize the real and imaginary parts are 0 ii, arg constructor, the real and imaginary parts of the parameter initialization iii output plural members the function iv member function overloaded complex addition v overloaded complex addition, three-dimensional data type, such as a+bi+cj (where abc is a real number), the addition rule for (a1+b1i+c1j)+ (a2+b2i+c2j) = (a1+a2 to a friend )+ (b1+b2) i+ (c1+c2) j requires i, based topic plural, using inheritance to construct 3D data classes (including parameters and parameter constructor) ii way overloaded member function of the three-dimensional data Addition iii friend way overloaded three-dimensional data addition
(系统自动生成,下载前可以参看下载内容)
下载文件列表
作业5运算符的从载 复数加法\fushu1.cpp
..........................\fushu2.cpp
..........................\作业5.doc
作业5运算符的从载 复数加法