文件名称:ComplexNumber
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:1.2kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
(1)编写一个复数类ComplexNumber,其中包括实例变量real、image,方法如下: 1)构造方法 ComplexNumber(double a,double b) 2) ComplexNumber add(ComplexNumber x) //当前复数对象与另一复数对象进行复数的加法运算,返回一新的复数对象 3) ComplexNumber sub(ComplexNumber x) //当前复数对象与另一复数对象进行复数的减法运算,返回一新的复数对象 4)double getReal () //获取复数对象的实部 5)double getImage () //获取复数对象的虚部 6)void show( ) //按照实部+虚部i(如10+8i)的形式显示复数对象的值 7)String toString()//返回复数对象对应的串(如4+7i) -(1) the preparation of a complex class ComplexNumber, including instance variables real, image, as follows: 1) construction method ComplexNumber (double a, double b) the 2) ComplexNumber add (ComplexNumber x)// plural object with another plural object plural addition operations, and return a new complex object 3) ComplexNumber sub (ComplexNumber x)// plural object with another plural object subtraction of complex numbers, and returns a new complex object 4) a double getReal ()// access to complex objects the imaginary part of the real part 5) double getImage ()// Get the plural object) void show ()// display in accordance with the+ imaginary of the real part of the Department of i (such 10+8i) in the form of the value of the complex object) String toString ()// return complex object corresponding to the string (such as 4+7i)
(系统自动生成,下载前可以参看下载内容)
下载文件列表
ComplexNumber.java
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.