曾新洲



摘要:Java語言有三種循環語句:while循環語句、for循環語句和do…while循環語句,其中for循環語句使用最為靈活、應用更廣泛。針對兩個學習情境:“輸出前10個自然數”和“輸出9*9乘法表”,采用啟發式教學法,引導學生找出循環變量、循環體、循環執行條件等,從而構建出單重for循環語句,再通過單重循環語句之間的關系,啟發學生完成雙重for循環語句。
關鍵詞:Java語言;for循環語句;雙重循環語句
中圖分類號:TP312 文獻標識碼:A 文章編號:1009-3044(2018)23-0198-03
Abstract: There are three kinds of loop statements in Java language: while loop statement, for loop statement and do...While loop statement, in which the for loop statement is the most flexible and widely used. For two learning situations: "output the first 10 natural numbers" and "output 9*9 multiplication tables", heuristic teaching method is used to guide students to find out loop variables, loop bodies, loop execution conditions, etc., constructing a single for loop statement, and then through the relationship between the single cycle sentences, the students will be inspired to complete the double for loop statement.
Key words: Java Language; For Loop Statements; Double Loop Statement
TIOBE編程語言排行榜使用Google、百度、Yahoo等著名搜索引擎進行計算,是編程語言流行趨勢的一個重要指標,該排行榜每月更新,TIOBE 2018 6月編程語言排行榜顯示Java語言指數為15.368%[1],在所有語言中排名第一,Java語言中有三種最基本的循環語句:while循環語句、for循環語句和do…while循環語句[2]。這三種循環語句的執行原理基本相同,在教學過程中,只需重點講解一種循環語句即可,而for循環語句與其他兩種循環語句相比,結構更緊湊,各部分功能更符合人民的思維習慣,特別是在多重循環中,for循環語句的特點尤為明顯。對于高職院校的學生來說,由于英語、數學基礎較差,很難掌握for循環語句執行過程,教師在教學過程中可綜合利用情境教學法、啟發式教學法、模仿教學法等進行講解。for循環語句分為單重循環和多重循環,以下就這兩種循環分別進行介紹。
1 單重for循環語句
4 結束語
循環語句的教學過程,實際上就是找規律的過程,可先采用簡單的java語句輸出所需結果,然后使用變量替換的方式,將簡單的java語句轉換成重復執行的java語句,最后將重復執行的java語句作為循環體,同時將替換變量作為循環變量,確定循環變量初始值、循環變量的變化及最終值,并組合成for循環語句。……