1 / 15
文档名称:

C语言程序设计论文.doc

格式:doc   大小:124KB   页数:15页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

C语言程序设计论文.doc

上传人:phl808 2019/9/24 文件大小:124 KB

下载得到文件列表

C语言程序设计论文.doc

相关文档

文档介绍

文档介绍:C语言程序设计论文————————————————————————————————作者:————————————————————————————————日期: C语言程序设计论文学校:天津电子信息职业技术学院系别:电子技术系专业:通信技术班级:通信S13-26学号:89757姓名:王磊C语言课程设计报告设计题目:计算器设计目标:进一步加深、巩固学生所学专业课程(《C语言》)的基本理论知识,理论联系实际,进一步培养学生综合分析问题和解决问题的能力。掌握运用C语言独立地编写、调试应用程序和进行其它相关设计的技能,充分发挥广大同学的潜力,使他们通过本次课程设计而得到全面的锻炼。设计内容:、流程图;;;;。课程设计所用设备:每人一台计算机。课程设计系统组成及模块功能:主函数模块设置系统进入图形模块初始化图形系统模块计算器计算函数模块窗口函数模块设计鼠标图形函数模块获取特殊键函数模块六、软件环境:Visualc++:在计算机上操作,通过Visualc++,设计出“计算器”程序。应提交的材料:实****报告一份,内容包含“计算器”程序代码。设计报告:程序代码:#include<>#include<>#include<>#include<>#include<>#include<>#include<>#include<>#include<>#defineUP0x48#defineDOWN0x50#defineLEFT0x4b#defineRIGHT0x4d#defineENTER0x0dvoid*rar;structpalettetypepalette;intGraphDriver; intGraphMode; intErrorCode; intMaxColors; intMaxX,MaxY; doubleAspectRatio; voiddrawboder(void);voidinitialize(void);puter(void);voidchangetextstyle(intfont,intdirection,intcharsize);voidmwindow(char*header);intspecialkey(void);intarrow();intmain(){initialize();computer(); closegraph();return(0);}voidinitialize(void){intxasp,yasp;GraphDriver=DETECT;initgraph(&GraphDriver,&GraphMode,"");ErrorCode=graphresult(); if(ErrorCode!=grOk){printf("GraphicsSystemError:%s\n",grapherrormsg(ErrorCode));exit(1);}getpalette(&palette); MaxColors=getmaxcolor()+1; MaxX=getmaxx();MaxY=getmaxy(); getaspectratio(&xasp,&yasp); AspectRatio=(double)xasp/(double)yasp;}puter(void){structviewporttypevp;intcolor,height,width;intx,y,x0,y0,i,j,v,m,n,act,flag=1;floatnum1=0,num2=0,result;um[5],str2[20]={""},c,temp[20]={""};charstr1[]="+-789*/Qc=^%";mwindow("Calculator");color=7;getviewsettings(&vp); width=(+1)/10; height=(-10)/10;x=width/2;y=height/2; setfillstyle(SOLID_FILL,color+3);bar(x+width*2,y,x+7*width,y+height);setcolor(color+3);rectangle(x+width*2,y,x+7*width,y+height);setcolor(RED);outtextxy(x+3*width,y+height/2,"0.");x=2*width-width/2;y=2*height+height/2;for(j=0;j<4;