發表文章

目前顯示的是有「program」標籤的文章

寫程式基本觀念

一、寫重複結構repetition  structure 陳述式注意事項: (1)、 避免無窮迴圈 (infinite loop) 設定控制變數 設定條件 調整控制變數值  例如: $i = 10; // 設定控制變數 while ( $i > 0) { // 設定條件      // 迴圈工作區      echo $i ;      $i --; // 調整控制變數值 } (2)、若是迴號沒有明確重複次教,那就得另行設計結束迴圈的方式,例如控制變等於某一個值之時,再利用break 跳出迴號。 二、變數命名規則: class、object 使用大駝峰型 (Upper Camel Case),Ex.UserName class、object 之屬性與方法,使用小駝峰型 (Lower Camel Case) ,Ex. userName function、variable 一律小寫

程式常見辭彙

A assignment operator 指派運算子 arithmetic operator 算術運算子 B break statement  中斷陳述  boolean value 布林值 C character 字元 class        類別 condition  條件 compound statement 複合陳述         control structure 控制結構         repetition  structure 重複結構  (又稱 loop 迴圈)  constant  常數 compile   編譯 construct 建構子 D destructor 解構子 E expression 運算式 equality and relational operator 相等性及關係運算子 Encrypt    加密;將...譯成密碼 F function    函數 I identifier 識別字 integer   整數 indentation  縮排 infinite loop 無窮迴圈 L lower camel case 小寫駝峰型 literal     字面常數 loop      迴圈 K keyword   識別字 M method    方法 method invocation  方法呼叫 P property   屬性 precedence 計算優先次序 parameter list 參數列 O object       物件...