211606325 邱東寶 211606312 賴志斌git
PSP2.1 | Personal Software Process Stages | 預估耗時(分鐘) | 實際耗時(分鐘) |
---|---|---|---|
Planning | 計劃 | ||
• Estimate | • 估計這個任務須要多少時間 | 10 | 10 |
Development | 開發 | ||
• Analysis | • 需求分析 (包括學習新技術) | 60 | 60 |
• Design Spec | • 生成設計文檔 | 60 | 140 |
• Design Review | • 設計複審 | 20 | 20 |
• Coding Standard | • 代碼規範 (爲目前的開發制定合適的規範) | 20 | 40 |
• Design | • 具體設計 | 20 | 20 |
• Coding | • 具體編碼 | 500 | 300 |
• Code Review | • 代碼複審 | 20 | 100 |
• Test | • 測試(自我測試,修改代碼,提交修改) | 200 | 300 |
Reporting | 報告 | ||
• Test Repor | • 測試報告 | 40 | 100 |
• Size Measurement | • 計算工做量 | 15 | 10 |
• Postmortem & Process Improvement Plan | • 過後總結, 並提出過程改進計劃 | 50 | 100 |
合計 | 1200 |
我經過網上搜索的方式瞭解到,小學三年級四則混合運算的幾個特色:算法
通過分析,我認爲,這個程序應當:數組
在寫逆波蘭算法的時候遇到了許多錯誤,咱們進行了屢次的調試。學習
Stack<Integer>nums = new Stack<Integer>();//保存數字 Stack<Character>opes = new Stack<Character>();//保存操做符 int n = 0;//保存數字 char[] cs = string.toCharArray();//字符串轉換爲char數組 for(int i = 0;i<cs.length;i++){ char t =cs[i]; if(Character.isDigit(cs[i])){ n=10*n+Integer.parseInt(String.valueOf(t)); }else{ System.out.println("i:"+n+","+cs[i]); if(n!=0){ System.out.println(n+cs[i]); nums.push(n); n=0; } if(t=='('){ opes.push(t); }else if(t==')'){ while(opes.peek()!='('){ int a =cal(nums.pop(),nums.pop(),opes.pop());nums.push(a);} opes.pop(); } else if(isType(t)>0){ if(opes.isEmpty()){ opes.push(t); }else{ if(isType(opes.peek())>=isType(t){ int a = cal(nums.pop(),nums.pop(),opes.pop());nums.push(a)}opes.push(a); }
因爲能力不足,兩我的沒想出怎麼解決如何在命令行輸入所需格式參數且順序不限,所以測試只能用一開始的輸入方法測試,並且三年級的尚未解決。測試
測試 | 預計結果 | 實際結果 |
---|---|---|
不輸入參數 | 輸入有誤! | 輸入有誤! |
只輸入一個參數:100 | 輸入有誤! | 輸入有誤! |
-n 10 -grade 1 | 題目已經生成 | 題目已經生成 |
-n 10.5 -grade 1 | 輸入有誤! | 輸入有誤! |
-n ascc -grade 2 | 輸入有誤! | 輸入有誤! |