现在是一段核心程序,只有单位数的四则运算,需要实现多位数运算和小数点功能,最好还有正负号。万分感谢!import java.awt.*;import java.applet.*;public class calc10 extends Applet {char key,prevopr;float ans,num;char[] btext={'0','1','2','3','4','5','6','7','8','9','-','+','*','/'};Button[] buttons = new Button[btext.length];public void init() {for (int i=0; i<btext.length; i++) {buttons[i] = new Button(""+btext[i]);add(buttons[i]);}}public float apply(float num1, char opr, float num2) {switch (opr) {case '+': return(ans+num);case '-': return(ans-num);case '*': return(ans*num);case '/': return(ans/num);default: return(num);}}public boolean action(Event evt,Object arg){key = ((String)arg).charAt(0); if(key>='0' && key<='9') {num = (float)(key-'0');showStatus(""+key);} else {ans = apply(ans,prevopr,num);showStatus( "" + ans );prevopr=key;}return true;}}