標題:
[隨堂練習] TQC+ 109 變數範圍
[打印本頁]
作者:
周政輝
時間:
2016-12-24 10:49
標題:
[隨堂練習] TQC+ 109 變數範圍
本帖最後由 周政輝 於 2016-12-24 10:57 編輯
[attach]1841[/attach]
作者:
張健勳
時間:
2016-12-24 10:49
public class JPA01 {
public static int adder (int s, int a, int e) {
return s+a+e;
}
public static int gameRating (int s, int a, int e) {
return adder(s,a,e);
}
public static void main (String argv[]) {
int skill = 6, action = 9, excitment = 8, result;
result = gameRating(skill, action, excitment);
System.out.print("The rating of the game is ");
System.out.println(result);
}
}
複製代碼
作者:
王彥甯
時間:
2016-12-24 10:49
public class JPA01 {
public static int adder (int s , int a , int e) {
return s+a+e;
}
public static int gameRating (int s, int a, int e) {
return adder(s , a , e);
}
public static void main (String argv[]) {
int skill = 6, action = 9, excitment = 8, result;
result = gameRating(skill, action, excitment);
System.out.print("The rating of the game is ");
System.out.println(result);
}
}
複製代碼
作者:
謝瀞儀
時間:
2016-12-24 10:49
本帖最後由 謝瀞儀 於 2016-12-24 10:50 編輯
public class JPA01 {
public static int adder (int s, int a, int e) {
return s+a+e;
}
public static int gameRating (int s, int a, int e) {
return adder(s,a,e);
}
public static void main (String argv[]) {
int skill = 6, action = 9, excitment = 8, result;
result = gameRating(skill, action, excitment);
System.out.print("The rating of the game is ");
System.out.println(result);
}
}
複製代碼
作者:
蔡庭豪
時間:
2016-12-24 10:49
public class JPA01 {
public static int adder (int s, int a, int e) {
return s+a+e;
}
public static int gameRating (int s, int a, int e) {
return adder(s,a,e);
}
public static void main (String argv[]) {
int skill = 6, action = 9, excitment = 8, result;
result = gameRating(skill, action, excitment);
System.out.print("The rating of the game is ");
System.out.println(result);
}
}
複製代碼
作者:
蔡季樺
時間:
2016-12-24 10:51
public class JPD01 {
public static int adder (int s,int a,int e) {
return s+a+e;
}
public static int gameRating (int s, int a, int e) {
return adder(s,a,e);
}
public static void main (String argv[]) {
int skill = 6, action = 9, excitment = 8, result;
result = gameRating(skill, action, excitment);
System.out.print("The rating of the game is ");
System.out.println(result);
}
}
複製代碼
作者:
蔡季樺
時間:
2016-12-24 10:58
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*Math.PI;
}
static double calTriangle(double a, double b) {
return a*b/2;
}
static double calRectangle(double a, double b) {
return a*b;
}
}
複製代碼
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://seed.istak.org.tw/)
Powered by Discuz! 7.2