文件名称:Archive
介绍说明--下载内容均来自于网络,请自行研究使用
4) 创建一个名为Complex的类,进行复数的算术运算。复数的形式为:
realpart+imaginarypart*i
用浮点变量表示类的private数据。提供构造函数,能够对所声明的该类对象进行初始化。在不提供初始化值的情况下,该构造函数应包含默认值。针对以下功能,分别提供一个public成员函数。
(1)两个复数相加;
(2)两个复数相减
(3)用(a, b)的形式打印复数,其中a为实部,b为虚部。
-4) Create a class called Complex, and perform complex arithmetic operations. Plural form: realpart+imaginarypart* i said private data class with floating point variables. Provide a constructor, the object can be declared for the class is initialized. In the case do not provide initialization values, the constructor should contain default values. For the following functions, which provide a public member function. (A) two complex numbers (2) the subtraction of two complex (3) (a, b) in the form of plural printing, where a is the real part, b is the imaginary part.
realpart+imaginarypart*i
用浮点变量表示类的private数据。提供构造函数,能够对所声明的该类对象进行初始化。在不提供初始化值的情况下,该构造函数应包含默认值。针对以下功能,分别提供一个public成员函数。
(1)两个复数相加;
(2)两个复数相减
(3)用(a, b)的形式打印复数,其中a为实部,b为虚部。
-4) Create a class called Complex, and perform complex arithmetic operations. Plural form: realpart+imaginarypart* i said private data class with floating point variables. Provide a constructor, the object can be declared for the class is initialized. In the case do not provide initialization values, the constructor should contain default values. For the following functions, which provide a public member function. (A) two complex numbers (2) the subtraction of two complex (3) (a, b) in the form of plural printing, where a is the real part, b is the imaginary part.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
实验6-3.cpp
实验6-1.cpp
实验6-2.cpp