基于vcmfc的科学计算器程序实验报告(编辑修改稿)内容摘要:

amp。 (num2 = EPSINON) ){ num_buffer = 除数不能为零。 error = true。 } else{ thism_num = num1 / num2。 }break。 default:thism_num = thisnum2。 break。 } 结果如下图所示 ③科学性运算按钮的处理: 只需根据数值分析等为按钮进行算法的合理设计,正确赋值即可,具体代码如下: // 自然底数 e void CScience::OnButtonEConst() { thischeck()。 (_T(%lf) , M_E)。 fresh()。 } // 圆周率 ∏ void CScience::OnButtonPai() { thischeck()。 (_T(%lf) , M_PI)。 fresh()。 } void CScience::OnButtonNi() { // 正负处理 m_result = atof( num_buffer )。 // 转化为字符串 ( _T(%lf), m_result )。 fresh()。 } void CScience::OnButtonMutInv() { thisunary_operation = true。 const double EPSINON =。 thism_result = atof( num_buffer )。 if ( (thism_result = EPSINON) amp。 amp。 (thism_result = EPSINON) ) { GetDlgItem(IDC_EDIT_SHOW)SetWindowText(0 的倒数没有定义 \n)。 } else { thism_result = / m_result。 ( _T(%lf), m_result )。 fresh()。 thisunary_operation = false。 } } void CScience::OnButtonPercent() { thisunary_operation = true。 CString tmp = num_buffer。 thism_result = atof(num_buffer)。 (_T(%lf) , thism_result * 100 )。 tmp += %。 fresh(tmp)。 thisunary_operation = false。 } void CScience::OnButtonSqr() { thisunary_operation = true。 thism_result = atof(num_buffer)。 thism_result = sqrt(m_result)。 (_T(%lf) , thism_result)。 fresh()。 thisunary_operation = false。 } void CScience::OnButtonSin() { CString tmp。 thisunary_operation = true。 thism_result = atof(num_buffer)。 (_T(%lf) , thism_result)。 tmp = Sin( + num_buffer + ) =。 thism_result = sin(m_result)。 (_T(%lf) , thism_result)。 tmp += num_buffer。 fresh(tmp)。 thisunary_operation = false。 } void CScience::OnButtonCos() { CString tmp。 thisunary_operation = true。 thism_result = atof(num_buffer)。 (_T(%lf) , thism_result)。 tmp = Cos( + num_buffer + ) =。 thism_result = cos(m_result)。 (_T(%lf) , thism_result)。 tmp += num_buffer。 fresh(tmp)。 thisunary_operation = false。 } void CScience::OnButtonTan() { CString tmp。 const double EPSINON =。 thisunary_operation = true。 thism_result = atof(num_buffer)。 (_T(%lf) , thism_result)。 tmp = tan( + num_buffer + ) =。 if ( (cos(m_result) = EPSINON) amp。 amp。 (cos(m_result) = EPSINON) ) { error()。 } else { thism_result = tan(m_result)。 (_T(%lf) , thism_result)。 tmp += num_buffer。 fresh(tmp)。 thisunary_operation = false。 } } void CScience::OnButtonCot() { CString tmp。 const double EPSINON =。 thisunary_operation = true。 thism_result = atof(num_buffer)。 (_T(%lf) , thism_result)。 tmp = cot( + num_buffer + ) =。 if ( (sin(m_result)。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。