1、產生隨機有理數php
2、生成題目html
3、計算題目java
4、測試類git
5、UML圖
web
import java.util.*; public class InfixToSuffix { private Stack<String> stack; private List<String> list; private String message, Message = ""; public InfixToSuffix() { stack = new Stack<String>(); // Store operator list = new ArrayList<String>(); // Store operation number and operator } public void conversion(String expr) { String token; StringTokenizer tokenizer = new StringTokenizer(expr); while (tokenizer.hasMoreTokens()) { // If tokenizer has the next value, loop and assign value. token = tokenizer.nextToken(); if (token.equals("(")) { // If the value of the token is the left parenthesis, then the stack stack.push(token); }else if (token.equals("+") || token.equals("-")) { // If the value of token is "+" or "-", once again determine whether the stack is empty. if (!stack.empty()){ // If the stack is not empty, judge what is the top element of the stack if (stack.peek().equals("(")) { // If the top of the stack is "(", the operator enters the stack stack.push(token); }else{ // Otherwise, remove the stack top elements first, add them to the list, // and then stack the operators into the stack. list.add(stack.pop()); stack.push(token); } }else { // Otherwise the operator enters the stack stack.push(token); } }else if (token.equals("*") || token.equals("÷")){ // If the value of token is "*" or "÷", it again determines whether the stack is empty. if (!stack.empty()) { // If the stack is not empty, judge what is the top element of the stack if (stack.peek().equals("*") || stack.peek().equals("÷")) { // If the top of the stack is "*" or "÷", remove the stack top elements first, // add them to the list, and then stack the operators into the stack. list.add(stack.pop()); stack.push(token); }else { // In addition, the operator directly enters the stack. stack.push(token); } }else { // If the stack is empty, the operator goes directly to the stack stack.push(token); } } else if (token.equals(")")) { // If encounter "), starts to circulate while (true) { // Remove the top element of the stack and assign it to A String A = stack.pop(); if (!A.equals("(")) { // If A is not "(", it is added to the list list.add(A); } else { // If A is "(", exit the loop break; } } }else { // If it is an arithmetic number, enter the list list.add(token); } } while (!stack.empty()) { // Remove elements from the stack and add them to the list until the stack is empty. list.add(stack.pop()); } ListIterator<String> li = list.listIterator(); while (li.hasNext()) { Message += li.next() + " "; // The elements in iterator are taken out in turn, and spaces are used as separators. li.remove(); } message = Message; } public String getMessage() { return message; } }
StringTokenizer類
,是張旭升學長在某個晚自習交給咱們的。int j = 0; System.out.print("請輸入要生成的題目數:" ); count = number.nextInt(); while (count == 0) { System.out.println("錯誤,請輸入有效數字!(最小爲1,理論無上限)"); System.out.print("請輸入要生成的題目數:"); count = number.nextInt(); } System.out.print("請輸入生成題目的級別(每增長一級多一個運算符,最低爲一級):"); level = number.nextInt(); while (level == 0) { System.out.println("錯誤,請輸入有效數字!(最小爲1,理論無上限)"); System.out.print("請輸入生成題目的級別(每增長一級多一個運算符,最低爲一級):"); level = number.nextInt(); }
PSP2.1 | Personal Software Process Stages | 預估耗時(小時) | 實際耗時(小時) |
---|---|---|---|
Planning | 計劃 | 0.5 | 1.5 |
Estimate | 估計這個任務須要多少時間 | 0.5 | 0.5 |
Development | 開發 | 20 | 45 |
Analysis | 需求分析 (包括學習新技術) | 2 | 2 |
Coding Standard | 代碼規範 (爲目前的開發制定合適的規範) | 3 | 3.5 |
Design UML | 設計項目UML類圖 | 1.5 | 2 |
Coding | 具體編碼 | 10 | 20 |
Code Review | 代碼複審 | 2 | 2 |
Test | 測試(自我測試,修改代碼,提交修改) | 2 | 2 |
Size Measurement | 計算工做量(實際時間) | 0.5 | 1 |
Postmortem & Process Improvement Plan | 過後總結, 並提出過程改進計劃 | 1 | 1.5 |
合計 | 43 | 94 |