109 變數範圍
public class JPA109 {
public static int addr(int skill, int action, int excitement) {
return skill + action + excitement; // 回傳三個分數的加總
}
public static int gameRating(int skill, int action, int excitement) {
return addr(skill, action, excitement); // 呼叫 adder 方法取得總分
}
public static void main(String[] args) {
int skill = 6; // 技能分數
int action = 9; // 動作分數
int excitement = 8;
// 呼叫 gameRating 方法取得遊戲評分結果
int result = gameRating(skill, action, excitement);
System.out.print("The rating of the game is "+result);
}
}