编一个java应用程序。程序中有3个类:Trangle、Trapezoid和Circle,用来刻画“三角形”、“梯形”和“圆形

谢谢急用... 谢谢 急用 展开
 我来答
myronxuyang
2010-05-13 · TA获得超过132个赞
知道小有建树答主
回答量:235
采纳率:0%
帮助的人:274万
展开全部
public class Triangle
{
private double edge1;
private double edge2;
private double edge3;

public Triangle(double edge1,double edge2,double edge3)
{
this.edge1=edge1;
this.edge2=edge2;
this.edge3=edge3;
}

public double getEdge1() {
return edge1;
}

public void setEdge1(double edge1) {
this.edge1 = edge1;
}

public double getEdge2() {
return edge2;
}

public void setEdge2(double edge2) {
this.edge2 = edge2;
}

public double getEdge3() {
return edge3;
}

public void setEdge3(double edge3) {
this.edge3 = edge3;
}

}

class Trapezoid
{
private double upedge;
private double downedge;
private double height;

public Trapezoid(double upedge,double downedge,double height)
{
this.upedge=upedge;
this.downedge=downedge;
this.height=height;
}

public double getUpedge() {
return upedge;
}

public void setUpedge(double upedge) {
this.upedge = upedge;
}

public double getDownedge() {
return downedge;
}

public void setDownedge(double downedge) {
this.downedge = downedge;
}

public double getHeight() {
return height;
}

public void setHeight(double height) {
this.height = height;
}

}

class Circle
{
private double radius;

public Circle(double radius)
{
this.radius=radius;
}

public double getRadius() {
return radius;
}

public void setRadius(double radius) {
this.radius = radius;
}

}
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 1条折叠回答
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式