| 网站首页 | 业界新闻 | 群组 | 交易 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛

已结贴   问题点数：20  回复次数：3

package qiugengongshi;

public class Root {

private double a,b,c,derta;

public double getFirstA(){
return a;}
public void setFirstA(double a){
this.a=a;
}

public double getSecondB(){
return b;}
public void setSecondB(double b){
this.b=b;}

public double getThirdC(){
return c;}
public void setThirdC(double c){
this.c=c;}

//怎么在这写一个判断derta的值，并且返回给Main类
public double calculateRoot1(double a,double b, double c){

return (-b+Math.sqrt(b*b-4*a*c))/(2*a);}

public double calculateRoot2(double a,double b ,double c){
return (-b-Math.sqrt(b*b-4*a*c))/(2*a);
}

}

得分:8

public double getA() {
return a;
}

public void setA(double a) {
this.a = a;
}

public double getB() {
return b;
}

public void setB(double b) {
this.b = b;
}

public double getC() {
return c;
}

public void setC(double c) {
this.c = c;
}
得分:8
//怎么在这写一个判断derta的值，并且返回给Main类
public double calculateRoot1(double a,double b, double c){
return (-b+Math.sqrt(b*b-4*a*c))/(2*a);
}

public double calculateRoot2(double a,double b ,double c){
return (-b-Math.sqrt(b*b-4*a*c))/(2*a);
}

得分:4

[code]/*~个性签名:bug是什么意思?bug是看上去没有可能的东西实际上是有可能做到的 就是这样~2018-08-08更~*/[/code]
• 4
• 1/1页
• 1