java编程题,急!
答案:2 悬赏:20 手机版
解决时间 2021-04-06 14:19
- 提问者网友:心如荒岛囚我终老
- 2021-04-06 07:30
java编程题,急!
最佳答案
- 五星知识达人网友:空山清雨
- 2021-04-06 08:49
public static double multiple(double a, double b){return a*b;}
public static double dvd(double a, double b){return a/b;}
public static double op(double a){return a*-1;}
public static double daoshu(double a){return 1/a;}
public static double abs(double a){return Math.abs(a);}
public static double dvd(double a, double b){return a/b;}
public static double op(double a){return a*-1;}
public static double daoshu(double a){return 1/a;}
public static double abs(double a){return Math.abs(a);}
全部回答
- 1楼网友:千夜
- 2021-04-06 09:38
楼上正解
public class test_1_3 extends JFrame{
public static void main(String args[]){
multiple(20, 30);
dvd(20,20);
op(-20);
daoshu(2);
abs(23);
}
public static double multiple(double a, double b){
System.out.println("a*b="+a*b);
return a*b;
}
public static double dvd(double a, double b){
System.out.println("a/b="+a/b);
return a/b;
}
public static double op(double a){
System.out.println("a的相反数"+a*-1);
return a*-1;
}
public static double daoshu(double a){
System.out.println("a的倒数"+1/a);
return 1/a;
}
public static double abs(double a){
System.out.println("a的绝对值"+Math.abs(a));
return Math.abs(a);
}
}
public class test_1_3 extends JFrame{
public static void main(String args[]){
multiple(20, 30);
dvd(20,20);
op(-20);
daoshu(2);
abs(23);
}
public static double multiple(double a, double b){
System.out.println("a*b="+a*b);
return a*b;
}
public static double dvd(double a, double b){
System.out.println("a/b="+a/b);
return a/b;
}
public static double op(double a){
System.out.println("a的相反数"+a*-1);
return a*-1;
}
public static double daoshu(double a){
System.out.println("a的倒数"+1/a);
return 1/a;
}
public static double abs(double a){
System.out.println("a的绝对值"+Math.abs(a));
return Math.abs(a);
}
}
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯