网站大量收购独家精品文档,联系QQ:2885784924

VC++计算器课程设计报告.doc

  1. 1、本文档共22页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
PAGE PAGE 9 VC++计算器课程设计报告 1.作品名称:计算器 2.本次课程设计的目的 在程序设计中,通过设计、编制、调试一个模拟计算器的程序,加深对语法及语义分析原理的理解,并 实现对命令语句的灵活应用。 3.主要功能 实现计算器的功能。用户根据程序提示,输入数字或字符,选择要进行的运算,可以进行正弦、余弦、正切、开方、对数、加、减、乘、除、华氏温度与摄氏度之间的换算以及平方根的运算。 4.代码 #include process.h #includetime.h #define MAX 100 #include iostream.h #include conio.h #include stdlib.h #include math.h double number1,number2,answer,number3,num[10000]; int n,k=1; char input,val; class oopcalc { private: double x,y; double fartocel(double number1); double celtofar(double number1); double sqroot(double number1); void calcsqr(); void calccos(); void calctan(); void calcsin(); void calclog(); public: double getX(){return x;} double getY(){return y;} double set(){x=number1;y=number2;} double calcadd(double number1,double number2); double calcsub(double number1,double number2); double calcdiv(double number1,double number2); double calcmult(double number1,double number2); void calcfartocel(); void calcceltofar(); void calcsroot(); void exitprog(); void menu(); void caculate(); void test(); void badinput(); }; void oopcalc::calcsin() { coutThe Sin Function\n; coutEnter a number:; cinnumber1; answer=sin(number1); coutThe sin of number1 is answerendl; coutPress any key to continue\n; getch(); menu(); } void oopcalc::calccos(){ coutThe Cos Function\n; coutEnter a number:; cinnumber1; answer=cos(number1); coutThe cos of number1 is answerendl; coutPress any key to continue\n; getch(); menu(); } void oopcalc::calctan() { coutThe Tan Function\n; coutEnter a number:; cinnumber1; answer=tan(number1); coutThe tan of number1 is answerendl; coutPress any key to continue\n; getch(); menu(); } void oopcalc::calcsqr() { coutThe sqr Function\n; coutEnter a number:; cinnumber1; answer=(number1*number1); coutThe sqr of number1 is answerendl; coutPress any key to continue\n; getch(); menu(); } void oopcalc::calclog(){ coutThe Log Function\n; coutEnter a number:; cinnumber1; if(number1=0) { coutBad input!\n; c

文档评论(0)

yigang0925 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档