(1) 实现一个Point类,该类包含表示坐标的两个int型变量x、y,构造方法Point()和Point(int xx, int yy),返回x值和y值的int getX()和int getY()方法,计算两点间距离的double distance(Point)方法。其中计算平方根用math.sqrt()方法。 (2) 实现一个Circle类,该类包含表示圆心的Point型变量center,表示半径的int radius变量,以及构造方法Circle()、Circle(int xx,int yy,int r)、Circle(Point c,int r),返回周长和面积的int perimeter()、double area()方法,返回两个圆是否为同一个圆(返回0)、同心圆(返回1)、相交的圆(返回2)、分离的圆(返回3)、包含的圆(返回4)等关系的int relation(Circle c)等方法。PI值可以用math.PI常量。 (3) 实现测试上述两个类的ClassTest类。该类在main方法中分别创建若干个Point对象和Circle对象,并调用相关方法,输出方法的返回值,验证其正确性。 (4) 将Point类、Circle类和主类的包名分别调整为p1、p2、p3,并重新运行,验证是否运行正确。
标签: Point
上传时间: 2014-11-25
上传用户:cylnpy
在MCS51上实现计算器的功能模块 (完成加减乘除正余弦开方正余切E的幂和对数等的运算,使用了Cx51标准库函数中math.h)
上传时间: 2016-08-28
上传用户:541657925
This sample displays a basic integer calculator powered by the 8051 microcontroller. Although Keil C51 has a full floating point math library the evaluation version is restricted to 2k of object code, so we have constrained this sample to integer maths in order to fit within this limit. The program for this design was written in C using the Keil uVision 2 IDE for which Proteus VSM provides a Debug Monitor driver. Instructions for configuring Proteus to run in conjunction with the Keil environment can be found by editing the 8051 microcontroller on the schematic (point at it and press CTRL-E) and then clicking on the help button on the Edit Component dialogue form.
标签: microcontroller calculator Although displays
上传时间: 2014-12-01
上传用户:edisonfather
THE DESIGN PATTERNS JAVA COMPANION 1. Creational Patterns 17 The Factory Pattern 18 How a Factory Works 18 Sample Code 18 The Two Derived Classes 19 Building the Factory 20 Factory Patterns in math Computation 22 When to Use a Factory Pattern 24 Thought Questions 25 The Abstract Factory Pattern 26 A GardenMaker Factory 26 How the User Interface Works 28 Consequences of Abstract Factory 30 Thought Questions 30 The Singleton Pattern 31 Throwing the Exception 32 Creating an Instance of the Class 32 Static Classes as Singleton Patterns 33 Creating Singleton Using a Static Method 34
标签: Creational COMPANION PATTERNS Patterns
上传时间: 2013-12-20
上传用户:xwd2010
Part2 using C++ Operators if you are dreading this chapter because you don t like math_relax. c++ does all your math for you!it is a miscon ception that you have to be good at math to understand how to program compters.
标签: math_relax Operators you dreading
上传时间: 2016-10-16
上传用户:tonyshao
Part5 using C++ Operators if you are dreading this chapter because you don t like math_relax. c++ does all your math for you!it is a miscon ception that you have to be good at math to understand how to program compters.
标签: math_relax Operators you dreading
上传时间: 2014-01-22
上传用户:wlcaption
The DSPLIB is a collection of 39 high-level optimized DSP functions for the TMS320C64x device. This source code library includes C-callable functions (ANSI-C language compatible) for general signal processing math and vector functions.
标签: collection high-level functions optimized
上传时间: 2016-10-16
上传用户:赵云兴
The DSPLIB is a collection of 39 high-level optimized DSP functions for the TMS320C64x device. This source code library includes C-callable functions (ANSI-C language compatible) for general signal processing math and vector functions.
标签: collection high-level functions optimized
上传时间: 2016-10-16
上传用户:gengxiaochao
用20个示例项目的方式介绍Matlab/Simulink。内容包括: *Contains over 20 hands-on projects in MATLAB(with code) integrated throughout the book *Includes a complete introduction to Simulink *Accompanied by a CD-ROM containing MATLAB examples, source code, third party simulations & projects *Suitable for self-study and professional licensing exams *Designed for the reader who does not have extensive math and programming experience *Contains many practical applications of MATLAB and Simulink
标签: Contains Simulink hands-on projects
上传时间: 2014-01-03
上传用户:hj_18
The MATLAB Compiler automatically converts MATLAB M-files to C and C++ code. The MATLAB Compiler includes the MATLAB C/C++ math and Graphics Libraries, which let you automatically convert your MATLAB applications to C and C++ code for stand-alone applications.
标签: MATLAB Compiler automatically The
上传时间: 2014-01-09
上传用户:凌云御清风