標題:
110
[打印本頁]
作者:
許承鴻
時間:
2018-6-5 19:08
標題:
110
import java.util.Scanner;
public class JPA01 {
public static void main(String args[]) {
double totalarea;
System.out.printf("圓形面積為:%f \n",calCircle(5));
System.out.printf("三角形面積為:%f \n",________________);
System.out.printf("方形面積為:%f \n",_______________);
totalarea = __________________________________________;
System.out.printf("此圖形面積為:%f \n",totalarea);
}
_______ ______ calCircle(_____) {
}
______ ____ calTriangle(_____________) {
}
______ ____ calRectangle(______________) {
}
}
作者:
顏羽彤
時間:
2018-6-5 19:25
package date0605;
import java.util.Scanner;
public class JPA01 {
public static void main(String args[]) {
double totalarea;
System.out.printf("圓形面積為:%f \n",calCircle(5));
System.out.printf("三角形面積為:%f \n",calTriangle(10,5));
System.out.printf("方形面積為:%f \n",calRectangle(5,10));
totalarea = calCircle(5)+calTriangle(10,5)+calRectangle(5,10);
System.out.printf("此圖形面積為:%f \n",totalarea);
}
static double calCircle(double a)
{
return a*a*3.1415926;
}
static double calTriangle(double a,double b)
{
return a*b/2;
}
static double calRectangle(double a,double b)
{
return a*b;
}
}
複製代碼
作者:
巫沛庭
時間:
2018-6-5 19:27
import java.util.Scanner;
public class JPA01 {
public static void main(String args[]) {
double totalarea;
System.out.printf("圓形面積為:%f \n",calCircle(5));
System.out.printf("三角形面積為:%f \n",calTriangle(10,5));
System.out.printf("方形面積為:%f \n",calRectangle(5,10));
totalarea = calCircle(5)+calTriangle(10,5)+calRectangle(5,10);
System.out.printf("此圖形面積為:%f \n",totalarea);
}
static double calCircle(double a) {
return a*a*3.1415926;
}
static double calTriangle(double a,double b) {
return a*b/2;
}
static double calRectangle(double a,double b) {
return a*b;
}
}
複製代碼
作者:
張閎鈞
時間:
2018-6-5 19:29
package hi87;
import java.util.*;
public class JPA01 {
public static void main(String args[]) {
double totalarea;
System.out.printf("圓形面積為:%f \n",calCircle(5));
System.out.printf("三角形面積為:%f \n",calTriangle(10,5));
System.out.printf("方形面積為:%f \n",calRectangle(5,10));
totalarea = calCircle(5)+calTriangle(10,5)+calRectangle(5,10);
System.out.printf("此圖形面積為:%f \n",totalarea);
}
static double calCircle( int a) {
return Math.pow(a,2) *3.1415926;
}
static double calTriangle(int b,int c) {
return b*c/2;
}
static double calRectangle(int d,int e) {
return d*e;
}
}
複製代碼
作者:
巫晉宇
時間:
2018-6-5 19:40
package dwaawd;
public class wdawdawad {
double totalarea;
System.out.printf("圓形面積為:%f \n", calCircle(5));
System.out.printf("三角形面積為:%f \n",calTriangle(10,5));
System.out.printf("方形面積為:%f \n",calRectangle(10,5));
totalarea = calCircle(5)+calTriangle(10,5)+calRectangle(10,5);
System.out.printf("此圖形面積為:%f \n",totalarea);
}
static double calCircle(int e) {
return e*e*3.14;
}
static double calTriangle(int e ,int o) {
return e*o/2;
}
static double calRectangle(int e,int o) {
return e*o;
}
}
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://seed.istak.org.tw/)
Powered by Discuz! 7.2