1、小組成員html
(本人)歐陽時康 201421122050 coding.net地址:【https://coding.net/u/conding_hjy/p/project-02/git/tree/oy_v1/】java
git
優酷視頻地址:【http://v.youku.com/v_show/id_XMzEwMjk3MjQwOA==.html?spm=a2h3j.8428770.3416059.1】編程
咱們在我的做業1中,用各類語言實現了一個命令行的四則運算小程序。進一步,本次要求把這個程序作成GUI,成爲一個有基本功能、必定價值的程序。在下面的功能需求中實現兩個:小程序
功能描述:dom
語言切換:學習
public static void init(String name) { try{ //讀取屬性文件a.properties InputStream in = new BufferedInputStream (new FileInputStream(name)); prop.load(in); ///加載屬性列表 Iterator<String> it=prop.stringPropertyNames().iterator(); int index=0; while(it.hasNext()){ String key=it.next(); System.out.println(key+":"+prop.getProperty(key)); } in.close(); } catch(Exception e){ System.out.println(e); } }
運算生成:測試
public class Expression { public static final int operator_addition=1; public static final int operator_subtraction=2; public static final int operator_multiplication=3; public static final int operator_division=4; //public static String exp=""; public static int operators=3; public static String getExpression(int max) { String exp=""; Random random = new Random(); boolean right=false, left=false; int operator_num = random.nextInt(operators) + 1; if (left == false && operator_num > 1) { if (random.nextInt(2) == 1) { exp += "("; left = true; } } exp += NumberRandom.getNumber(max); for (int j = 0; j < operator_num; j++) { String add1 = "", add2 = ""; if (left == true && right == false && operator_num > 1) { if (operator_num == 2) { add2 = ")"; right = true; } else { if (random.nextInt(2) == 1) { add2 = ")"; right = true; } } } else if (left == false && operator_num > 1) { if (random.nextInt(2) == 1) { add1 = "("; left = true; } } switch (random.nextInt(operators+1)+1) { case operator_addition: exp += " + " + add1 + NumberRandom.getNumber(max) + add2; break; case operator_subtraction: exp += " - " + add1 + NumberRandom.getNumber(max) + add2; break; case operator_multiplication: exp += " × " + add1 + NumberRandom.getNumber(max) + add2; break; case operator_division: exp += " ÷ " + add1 + NumberRandom.getNumber(max) + add2; break; default: break; } } if (left == true && right == false) { exp += ")"; } //System.out.println(exp); return exp; } public static void main(String[] args) { System.out.println(getExpression(10)); } }
1.用戶登陸:編碼
2.顯示用戶,答題數量,錯題數量,正確數量,正確率,錯題複習spa
3.運算生成
4.答案生成
5.我的檢驗
6.切換語言
6、小結感覺
優勢:java不懂直接問,有問必答,業務邏輯清晰,合做愉快
缺點:對於代碼規範問題有待提升,如命名,註釋規範
但願他提升的地方:代碼風格,冗餘度,代碼耦合度等還尚需提升。
八、描述照片
PSP2.1 | Personal Software Process Stages | Time Senior Student | Time |
Planning | 計劃 | 30 | 20 |
· Estimate | 估計這個任務須要多少時間 | 10 | 10 |
Development | 開發 | 600 | 500 |
· Analysis | 需求分析 (包括學習新技術) | 30 | 50 |
· Design Spec | 生成設計文檔 | 10 | 15 |
· Design Review | 設計複審 | 10 | 15 |
· Coding Standard | 代碼規範 | 20 | 10 |
· Design | 具體設計 | 50 | 40 |
· Coding | 具體編碼 | 100 | 150 |
· Code Review | 代碼複審 | 50 | 50 |
· Test | 測試(自我測試,修改代碼,提交修改) | 50 | 50 |
Reporting | 報告 | 20 | 10 |
測試報告 | 20 | 10 | |
計算工做量 | 10 | 15 | |
並提出過程改進計劃 | 10 | 15 |