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 |