本帖最後由 李泳霖 於 2022-9-17 13:48 編輯
1. gameRating函數需呼叫adder方法以取得正確的加總值。
2. adder方法計算方式為: skill+action+excitement
3. 輸出回傳的正確值,顯示結果如參考畫面
- public class JPD01 {
-
- public static int adder (__________________) {
- return _______________;
- }
-
- public static int gameRating (int s, int a, int e) {
- return adder(__________________);
- }
-
- 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);
- }
- }
複製代碼 |