第一范文网 - 专业文章范例文档资料分享平台

VC++课程设计

来源:用户分享 时间:2025/6/16 17:58:13 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

科学计算器设计

m_xx=m_xx+\ str='f';

UpdateData(false);

// TODO: Add your control notification handler code here }

void CMyDlg::Onkf() { s2=\ s1=m_xx;

m_xx=m_xx+\ str='k';

UpdateData(false); // TODO: Add your control notification handler code here }

void CMyDlg::Onln() {s2=\ s1=m_xx; m_xx=\ str='l';

UpdateData(false);

// TODO: Add your control notification handler code here }

void CMyDlg::Onlog() { s2=\ s1=m_xx;

m_xx=\ str='g';

UpdateData(false);

// TODO: Add your control notification handler code here }

void CMyDlg::Onpf()

- - 16 - -

科学计算器设计

{s2=\ s1=m_xx; m_xx=m_xx+\ str='p';

UpdateData(false);

// TODO: Add your control notification handler code here }

void CMyDlg::Onsin() {s2=\ s1=m_xx;

m_xx=\ str='s';

UpdateData(false);

// TODO: Add your control notification handler code here }

void CMyDlg::Onsub() { s2=\ s1=m_xx; m_xx=m_xx+'-'; str='-';

UpdateData(false);

// TODO: Add your control notification handler code here }

void CMyDlg::Onsze() { s2=\ int n,i,t; double Y,p=0.0;

Y=strtod( m_xx,NULL); t=(int)(Y); if(t!=1)

for(i=1;t>1;i++)

- - 17 - -

科学计算器设计

{

n=t%2; t=t/2;

p+=n*pow(10,(i-1)); }

p+=1*pow(10,(i-1)); m_xx.Format(\

UpdateData(false);// TODO: Add your control notification handler code here }

void CMyDlg::Ontan() {s2=\ s1=m_xx;

m_xx=\ str='t';

UpdateData(false);

// TODO: Add your control notification handler code here }

void CMyDlg::Onxy() { s2=\ s1=m_xx; m_xx=m_xx+\ str='^';

UpdateData(false); // TODO: Add your control notification handler code here }

void CMyDlg::Onds() {s2=s2+\ m_xx=m_xx+\

- - 18 - -

科学计算器设计

UpdateData(false);

// TODO: Add your control notification handler code here }

(2)函数功能说明

整个计算器除了基本的加、减、乘、除运算外,另外还有8个功能,实现八大运算:三角函数运算功能、对数函数运算功能、指数函数运算功能、乘方运算功能、平方运算功能、根式运算功能、进制转换功能、归零功能。各个运算功能的详细设计说明分别如下: 1、基本运算功能

主要实现数据的加、减、乘、除运算,提供简单的科学计算! 2、三角函数运算功能

用来执行三角函数的运算,包括正弦函数(sin)、余弦函数(cos)、正切函数(tan)和余切函数(cot)。 3、对数函数运算功能

用来执行对数函数的运算,包括以e为底ln函数和以10为底的lg函数。 4、指数函数运算功能 用来执行指数函数的运算。 5、乘方运算功能

用来执行乘方的运算,进行数值的成倍计算。 6、平方运算功能

用来执行平方运算,说到底它也属于乘方运算的范畴。 7、根式运算功能 用来执行根式的运算。 8、进制转换运算功能

主要实现数值间的转换,包括二进制转十进制、十进制转二进制和八进制转二进制的运算。

二进制转十进制N-S流程图:

int len; double sum=0.0,num; len=strlen(m_xs); int i=0;i

搜索更多关于: VC++课程设计 的文档
VC++课程设计.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c1cfik0oro60sr9z0o3lu_5.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top