今天进行讨论基础功能的核心代码方面,还有简单的讨论继续关于界面的美化,

计算生成的答案功能

public class Core 
{
//char[]h={'+','-','*','/'};
int resultfront,resultback,result;
public int Cal(int i1,int i2,int a,int b,int c)//加法
{
if(i2==2||i2==3){
switch (i2){
case 2:resultback=b*c;break;
case 3:resultback=b/c;break;}
switch (i1){
case 0:result=a+resultback;break;
case 1:result=a-resultback;break;
case 2:result=a*resultback;break;
case 3:result=a/resultback;break;}
return result;
}
else
{
switch (i1){
case 0:resultfront=a+b;break;
case 1:resultfront=a-b;break;
case 2:resultfront=a*b;break;
case 3:resultfront=a/b;break;}

switch (i2){
case 0:result=resultfront+c;break;
case 1:result=resultfront-c;break;
case 2:result=resultfront*c;break;
case 3:result=resultfront/c;break;}
return result;
}
}

05-04 04:13