返回列表 發帖

TQC+ 109 變數範圍

本帖最後由 李泳霖 於 2022-9-17 13:44 編輯

1. gameRating函數需呼叫adder方法以取得正確的加總值。
2. adder方法計算方式為: skill+action+excitement
3. 輸出回傳的正確值,顯示結果如參考畫面
  1. public class JPD01 {
  2.   
  3.     public static int adder (__________________) {
  4.         return _______________;                                    
  5.     }
  6.    
  7.     public static int gameRating (int s, int a, int e) {
  8.         return adder(__________________);                                      
  9.     }
  10.   
  11.     public static void main (String argv[]) {
  12.         int skill = 6, action = 9, excitment = 8, result;
  13.         result = gameRating(skill, action, excitment);
  14.         System.out.print("The rating of the game is ");
  15.         System.out.println(result);                        
  16.     }
  17. }
複製代碼

此帖僅作者可見

TOP

此帖僅作者可見

TOP

此帖僅作者可見

TOP

此帖僅作者可見

TOP

此帖僅作者可見

TOP

此帖僅作者可見

TOP

此帖僅作者可見

TOP

此帖僅作者可見

TOP

此帖僅作者可見

TOP

返回列表