📄 calculator.java
字号:
/** * @Copyright(C) 2008 Software Engineering Laboratory (SELAB), Department of Computer * Science, SUN YAT-SEN UNIVERSITY. All rights reserved.**/
package parser;
import exceptions.*;
/**
* Main program of the expression based calculator ExprEval
*
* @author [PENDING your name]
* @version 1.00 (Last update: [PENDING the last update])
**/
public class Calculator
{
/**
* The main program of the parser. You should substitute the body of this method
* with your experiment result.
*
* @param expression user input to the calculator from GUI.
* @return if the expression is well-formed, return the evaluation result of it.
* @throws ExpressionException if the expression has error, a corresponding
* exception will be raised.
**/
public double calculate(String expression) throws ExpressionException
{
// You should substitute this method body ...
double result = ((int) (Math.random() * 1000000000)) / 100.0;
return result;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -