作业帮 > 英语 > 作业

在二维直角坐标系上,定义一个点类Point,由类Point派生定义描述一个线段的类Line.要求Line类的成员函数能计

来源:学生作业帮 编辑:作业帮 分类:英语作业 时间:2024/05/14 11:59:05
在二维直角坐标系上,定义一个点类Point,由类Point派生定义描述一个线段的类Line.要求Line类的成员函数能计算线段的长度.设计一个主函数充分测试所定义的类.
C++题目,我是真的不会做啊,大家帮帮忙啊!!!
In a two-dimensional Cartesian coordinate system, creating a point class, the class name is Point, class Line is derived from the class Point and then to implement a segment of line. and a method function of the class Line can calculate the length of line. Then design a main function test all class.
public class Point
{
int x;
int y;
int z;
}
public class Line:Point
{
public int getLong()
{
return x+y+z;
}
}
public class main()
{
static main()
{
line objline=new line;
objline.x=1;
objline.y=2;
objline.z=3;
printf("long",objline.getlong);
}
}
在二维直角坐标系上,定义一个点类Point,由类Point派生定义描述一个线段的类Line.要求Line类的成员函数能计 定义一个描述二维坐标系中点对象的类Point,它具有下述成员函数: 用point类公有派生一个line类,其数据成员为起点和终点,给出完整的line类定义,其中包括构造拷贝析构函数 5.定义一个表示点的结构类型Point和一个由直线方程 确定的直线类Line.结构类型Point由x和y两个成员,他 首先定义一个点类 POINT ,有两个 double 型的 保护 数据成员 x ,y 表示该类对象在二维坐标系中的坐标位 C++ 设有以下关于点point类的定义,请在此基础派生出一个正方形square类,用以描述正方形左上角的位置,边 JAVA 定义一个Point类 它的对象是指一个平面上的点(x,y),在定义Point类中要定义它的三个构造函数 定义一个Line类,包含两个Point类的实例变量,用以表示一个线段的两个端点.重载的构造方法,计算线段长度方法;判断线 .写一个C++程序,定义抽象基类Shape,由它派生出一个基类Point,再由Point派生出2个派生类:Circle( 定义一个Java类Point,用来描述平面直角坐标系中点的坐标.着急啊,在线等! Point类是对二维直角坐标系中的点的抽象.它拥有两个私有的数据成员,分别代表x和y坐标;另外有两个成员函数,一个是构造 定义一个Point类并用成员函数 double Distance(const& Point)求两点间距离