当前位置 :
用delphi科学计算器设计制作一个类似于Windows操作系统附件中所带的计算器程序,该程序具有标准型和科学型两大功能.系统功能要求1.标准型计算器,主要具有能进行加减乘出和求余等基本的
1人问答
更新时间:2024-03-29 07:14:10
问题描述:

用delphi科学计算器设计

制作一个类似于Windows操作系统附件中所带的计算器程序,该程序具有标准型和科学型两大功能.系统功能要求1.标准型计算器,主要具有能进行加减乘出和求余等基本的计算功能.2.科学型计算器除具有全部标准型功能外,还具有三角函数计算,如正弦、余弦、正切和对数计算,如自然对数和常用对数,指数计算如平方、立方和任意次方计算,在统计计算中,具有求和、求平均数等功能.在科学计算中,除了十进制数计算以外,还具有十六进制、八进制和二进制计算功能,在三角函数运算中,支持角度和弧度两种单位.总之,功能基本上和操作系统中的计算器类似.

侯竑回答:
  部分源代码   s_result:='0';   result:=0;   point_flag:=false;   operation_symbol:=0;   input_2:=false;   display_refresh();   end;   procedureTForm1.Button15Click(Sender:TObject);   begin   operation_over:=true;   source_1:=strtofloat(s_source_1);   ifinput_2then   begin   source_2:=strtofloat(s_source_2);   end   else   begin   //source_2:=source_1;   //s_source_2:=floattostr(source_2);   end;   caseoperation_symbolof   0:   begin   result:=source_1;   display_refresh();   exit;   end;   1:   begin   result:=source_1+source_2;   display_refresh();   end;   2:   begin   result:=source_1-source_2;   display_refresh();   end;   3:   begin   result:=source_1*source_2;   display_refresh();   end;   4:   begin   ifsource_2=0then   begin   messagebox(form1.Handle,'0不能做除数','错误!',0);   exit;   end;   result:=source_1/source_2;   display_refresh();   end;   end;   input_2:=false;   source_1:=result;   s_source_1:=floattostr(result);   s_source_2:='0';   point_flag:=false;   end;   procedureTForm1.Button19Click(Sender:TObject);   begin   ifresult>=0then   begin   operation_over:=true;   result:=sqrt(result);   display_refresh();   ifinput_2=truethen   begin   source_2:=result;   s_source_2:='0';   input_2:=false;   end   else   begin   s_source_1:=floattostr(result);   end;   end   else   begin   messagebox(form1.Handle,'负数不能开根号','错误!',0);   end;   end;   procedureTForm1.Button30Click(Sender:TObject);   begin   if(operation_symbol>0)and(input_2=true)then   begin   button15.Click;   end;   operation_symbol:=1;   //source_2:=0;   //s_source_2:='0';   point_flag:=false;   operation_over:=false;   end;   procedureTForm1.Button14Click(Sender:TObject);   begin   if(operation_symbol>0)and(input_2=true)then   begin   button15.Click;   end;   operation_symbol:=2;   //source_2:=0;   //s_source_2:=floattostr(source_2);   point_flag:=false;   operation_over:=false;   end;   procedureTForm1.Button13Click(Sender:TObject);   begin   if(operation_symbol>0)and(input_2=true)then   begin   button15.Click;   end;   operation_symbol:=3;   //source_2:=0;   //s_source_2:=floattostr(source_2);   point_flag:=false;   operation_over:=false;   end;   procedureTForm1
最新更新
优秀科学推荐
PC端 | 移动端 | mip端
问答网(wenda2.com)汇总了汉语字典,新华字典,成语字典,组词,词语,在线查字典,中文字典,英汉字典,在线字典,康熙字典等等,是学生查询学习资料的好帮手,是老师教学的好助手。
声明:本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。

邮箱:联系方式:

Copyright©2009-2021 问答网 wenda2.com 版权所有 闽ICP备2022000227号-1