文件名称:ComplexTest
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:1.3kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
个人原创代码:编写Java Application程序,定义一个复数(z=x+iy)类Complex,包含:
两个属性:实部x和虚部y
默认构造函数 Complex(),设置x=0,y=0
构造函数:Complex(int i,int j)
显示复数的方法:showComp()将其显示为如: 5+8i或5-8i 的形式。
求两个复数的和的方法:(参数是两个复数类对象,返回值是复数类对象)public Complex addComp(Complex C1,Complex C2)
求两个复数的差的方法:(参数是两个复数类对象,返回值是复数类对象)public Complex subComp(Complex C1,Complex C2)
求两个复数的乘积的方法:(参数是两个复数类对象,返回值是复数类对象,新复数实部=两复数实部乘积-两复数虚部乘积,新复数虚部=两复数实部与虚部交叉乘积之和,)public Complex multiComp(Complex C1,Complex C2)
比较两个复数是否相等的方法(参数是两个复数类对象,返回值是boolean类型)public boolean equalComp(Complex C1,Complex C2)
在Application中测试该类的方法,实部x和虚部y可由main方法参数提供输入。-Personal original code: using java application procedures, the definition of a complex number (z = x+ iy), Complex, including:
Two properties: the real part x and imaginary Ministry y
Default constructor Complex, (), set x = 0, y = 0
Constructor: Complex, (int i, int j)
The complex method: showComp () to display: 5+8 i or 5-8i form is displayed.
Seek two complex methods: (parameter two complex class object, the return value is a complex class object) public Complex addComp (Complex C1, Complex C2)
Seek two complex methods: (argument two complex class object, the return value is the plural class object) public Complex subComp (Complex C1, Complex C2)
Seeking the product of two complex numbers: (parameters are two complex class object, the return value is a complex class object, new plural = two of the real part of the complex product of the real part- two complex product of the imaginary part of the new complex imaginary part = two complex real and imaginary parts of the cros
两个属性:实部x和虚部y
默认构造函数 Complex(),设置x=0,y=0
构造函数:Complex(int i,int j)
显示复数的方法:showComp()将其显示为如: 5+8i或5-8i 的形式。
求两个复数的和的方法:(参数是两个复数类对象,返回值是复数类对象)public Complex addComp(Complex C1,Complex C2)
求两个复数的差的方法:(参数是两个复数类对象,返回值是复数类对象)public Complex subComp(Complex C1,Complex C2)
求两个复数的乘积的方法:(参数是两个复数类对象,返回值是复数类对象,新复数实部=两复数实部乘积-两复数虚部乘积,新复数虚部=两复数实部与虚部交叉乘积之和,)public Complex multiComp(Complex C1,Complex C2)
比较两个复数是否相等的方法(参数是两个复数类对象,返回值是boolean类型)public boolean equalComp(Complex C1,Complex C2)
在Application中测试该类的方法,实部x和虚部y可由main方法参数提供输入。-Personal original code: using java application procedures, the definition of a complex number (z = x+ iy), Complex, including:
Two properties: the real part x and imaginary Ministry y
Default constructor Complex, (), set x = 0, y = 0
Constructor: Complex, (int i, int j)
The complex method: showComp () to display: 5+8 i or 5-8i form is displayed.
Seek two complex methods: (parameter two complex class object, the return value is a complex class object) public Complex addComp (Complex C1, Complex C2)
Seek two complex methods: (argument two complex class object, the return value is the plural class object) public Complex subComp (Complex C1, Complex C2)
Seeking the product of two complex numbers: (parameters are two complex class object, the return value is a complex class object, new plural = two of the real part of the complex product of the real part- two complex product of the imaginary part of the new complex imaginary part = two complex real and imaginary parts of the cros
(系统自动生成,下载前可以参看下载内容)
下载文件列表
ComplexTest.java
本Java程序设计详细要求.txt
本Java程序设计详细要求.txt
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.