动态函数图像演示-C语言课程设计实验报告(含源码) 联系客服

发布时间 : 星期二 文章动态函数图像演示-C语言课程设计实验报告(含源码)更新完毕开始阅读

eaintheaccidentinvestigation,managementandreporting,eachpostshouldbedevelopedunderthissystemspecialistscheck,cleartheexaminations,time,cyclesandotherrelevantregulations.Strengtheningsitesupervisionandexamination,todetectandinvestigateillegalcommand,illegaloperationsandviolationsofoperatingrules.Secondsafetyreferstotheproductionsite,technologymanagement,equipment,facilities,andsooncanleadtoaccidentsrisksexist.1,accordingtotheextentofthesecurityrisks,solvingisdividedintoa,b,andclevelsofdifficulty;A-level:difficult,miningdifficulties,shallbereportedtothecompany'sproblems.B-class:difficulttoresolvedif 三、心得体会 经过了为期一周的c语言课程设计后,我学到了很多知识。以前总是注重理论知识,并没有能够很好的掌握这门课程。本次课设让我们进行实际操作的同时还巩固了上一学期的知识,而且还加深了对c语言的熟练掌握。但在这期间也遇到了困难,懂得了自己掌握的知识还不能够灵活运用。课设让我明白了自己的不足之处:缺乏实践经验。所以要平时应该多多动手,锻炼思维能力,积累自己的编码经验,为以后打好坚实的基础。 四、课设结果及总结 执行程序后,结果无误。画图程序可通过对话框来控制函数参数,曲线的粗细,曲线的颜色。并画出了动态的函数图像,而且能够将图像储存到文件中和打开图像文件。在完成课设时,通过查阅资料了解到了很多以前没有接触过的函数名,学 习到了很多新的知识,而且已经可以熟练的应用它们来编写程序。但在编写程过 程中,出现了编写程序思路不清晰的不足之处,我会在以后的学习中加强这方面 的能力。

iculties,shallconsistofminingorganizationstosolveproblems.C-class:fromsegmentsandbusinessrisksthatmustbeaddressedintheDepartment.2,open-pitmineunsafetypesinclude:electrical,transport,blasting,fire,andotherslope.3,accordingtotheseverityofthehazardfilledinbyunittroubleshooting,registrationform(seeatt5

eaintheaccidentinvestigation,managementandreporting,eachpostshouldbedevelopedunderthissystemspecialistscheck,cleartheexaminations,time,cyclesandotherrelevantregulations.Strengtheningsitesupervisionandexamination,todetectandinvestigateillegalcommand,illegaloperationsandviolationsofoperatingrules.Secondsafetyreferstotheproductionsite,technologymanagement,equipment,facilities,andsooncanleadtoaccidentsrisksexist.1,accordingtotheextentofthesecurityrisks,solvingisdividedintoa,b,andclevelsofdifficulty;A-level:difficult,miningdifficulties,shallbereportedtothecompany'sproblems.B-class:difficulttoresolvedif五、程序代码及注释

#include #include

#include /*textcolor,clrscr,wherex.y等的头文件*/ #include

#include /*键盘*/

#include /*时间函数*/ #define key_down 80 /*键盘值*/ #define key_up 72 #define key_esc 1 #define key_enter 28

int get_key(); /*获取键盘值函数*/ int width = 500, height = 500; /*图形坐标系的大小*/ int left = 20, top = 20;

void save(); /*保存图像函数*/ void load(); /*打开图像函数*/ void main()

{

int m,n,radius,form,hue,key,y; /*m,n 分别代表linestyle数组中的元素次序和元素在屏幕中的纵坐标*/

/*radius代表所画曲线的粗细*/ /* form代表所画曲线的形式*/ /* hue代表曲线的颜色*/ /* key代表键盘值*/

/* y代表首页界面中字符屏幕的纵坐标*/

int gdriver, gmode, i, j,num,time; /*griver,gmode代表初始化图形系统中的变量*/ /*i,j代表构建坐标系时表格的宽度与高度*/ /*num代表坐标系中的坐标刻度*/ /*time代表坐标刻度的纵轴刻度*/

float abc,ord,zong,hen,heng; /*abc代表画曲线时依次取得的自变量的值*/ /*ord代表所画曲线的应变量*/ /*zong,heng代表曲线的顶点坐标*/

char buf[20*20*4]; /*buf代表缓冲区的存储量*/ char*homepage[]={\ / *首界面的“进入”与“退出*/

char*menu[]={\ /*各个对话框的内容*/

char *argument[]={ \ \ /*在第一个对话框中输入函数参数的值*/

iculties,shallconsistofminingorganizationstosolveproblems.C-class:fromsegmentsandbusinessrisksthatmustbeaddressedintheDepartment.2,open-pitmineunsafetypesinclude:electrical,transport,blasting,fire,andotherslope.3,accordingtotheseverityofthehazardfilledinbyunittroubleshooting,registrationform(seeatteaintheaccidentinvestigation,managementandreporting,eachpostshouldbedevelopedunderthissystemspecialistscheck,cleartheexaminations,time,cyclesandotherrelevantregulations.Strengtheningsitesupervisionandexamination,todetectandinvestigateillegalcommand,illegaloperationsandviolationsofoperatingrules.Secondsafetyreferstotheproductionsite,technologymanagement,equipment,facilities,andsooncanleadtoaccidentsrisksexist.1,accordingtotheextentofthesecurityrisks,solvingisdividedintoa,b,andclevelsofdifficulty;A-level:difficult,miningdifficulties,shallbereportedtothecompany'sproblems.B-class:difficulttoresolvedif

char *factor[]={\ /* 函数参数的储存地址*/ /* char *linestyle[]={\ = 0\ = 1\ = 2\ = 3\= 4\ /*在第二个对话框中输入所画曲线的形式*/

char *color[]={\green\yellow\ /*在第三 \ /*第三个个对话框中输入曲线的颜色*/

textbackground(3); /* textcolor(0); clrscr();

gotoxy(18,10);

printf(\ SOFTWARE OF gotoxy(30,14);

printf(\ gotoxy(30,16);

printf(\

gettext(10,8,60,16,buf); key=0; while(1)

{ while(bioskey(1)==0); key=get_key(); if(key==key_enter&&y==16) exit(0); if(key==key_up||key==key_down) \的选择*/ {

y=wherey(); if(key==key_up) y=y==14? y-2:14;

if(key==key_down) y=y==16? y+2:16;

puttext(10,8,60,16,buf); gotoxy(30,y); if(y==14) {

textbackground(0); textcolor(6); gotoxy(30,y);

cprintf(\ }

if(y==16)

/*构建首界面*/ /*设置字符模式下的字符颜色*/ PICTURE\ /*保存矩形屏幕上的字符*/ /*读取键盘值*/ /*获取键盘值*/

/*在首界面中选择“Exit”程序退出*/

/*设定键盘控制光标的移动得意实现对“Enter”或 /*得到字符模式下窗口光标的y坐标数值*/ /*实现up键盘控制光标上移的功能*/ /*实现down键盘控制光标下移的功能*/ /*将gettext函数保存的字符恢复到屏幕上*/

/*将当前字符屏幕的光标位置移动到(30,y)坐标*/ /*设置字符模式下的背景颜色*/ /*设置字符模式下的字符颜色*/ iculties,shallconsistofminingorganizationstosolveproblems.C-class:fromsegmentsandbusinessrisksthatmustbeaddressedintheDepartment.2,open-pitmineunsafetypesinclude:electrical,transport,blasting,fire,andotherslope.3,accordingtotheseverityofthehazardfilledinbyunittroubleshooting,registrationform(seeatt7

eaintheaccidentinvestigation,managementandreporting,eachpostshouldbedevelopedunderthissystemspecialistscheck,cleartheexaminations,time,cyclesandotherrelevantregulations.Strengtheningsitesupervisionandexamination,todetectandinvestigateillegalcommand,illegaloperationsandviolationsofoperatingrules.Secondsafetyreferstotheproductionsite,technologymanagement,equipment,facilities,andsooncanleadtoaccidentsrisksexist.1,accordingtotheextentofthesecurityrisks,solvingisdividedintoa,b,andclevelsofdifficulty;A-level:difficult,miningdifficulties,shallbereportedtothecompany'sproblems.B-class:difficulttoresolvedif {

textbackground(0); textcolor(6); gotoxy(30,y);

cprintf(\ } }

if(key==key_enter&y==14) /*实现选择“Enter”进入程序的功能*/

{ window(1,1,80,25); /*建立字符模式下的矩形字符窗口*/ clrscr();

textbackground(14); textcolor(0); clrscr();

window(12,6,70,20);

printf(\ /*关于函数参数的对话框*/

gotoxy(10,4); /*将当前字符屏幕的光标位置移动到(10,4)坐标*/

printf(\

for(m=0,n=6;m<3;m++,n++) /*实现依次输入函数参数a,b,c的值并储存的功能*/ {

gotoxy(12,n);

printf(\ scanf(\ }

gotoxy(10,10); /*将当前字符屏幕的光标位置移动到(10,10)坐标*/

printf(\

gotoxy(14,14); /*将当前字符屏幕的光标位置移动到(14,14)坐标*/

printf(\ /*显示出函数的表达式*/ getch(); clrscr();

window(12,6,70,20);

printf(\ /*关于曲线形式的对话框*/

gotoxy(10,4); /*将当前字符屏幕的光标位置移动到(10,4)坐标*/

printf(\

for(m=0,n=6;m<5;m++,n++) /*实现依次输出曲线形式的选项*/ {

gotoxy(12,n);

printf(\

iculties,shallconsistofminingorganizationstosolveproblems.C-class:fromsegmentsandbusinessrisksthatmustbeaddressedintheDepartment.2,open-pitmineunsafetypesinclude:electrical,transport,blasting,fire,andotherslope.3,accordingtotheseverityofthehazardfilledinbyunittroubleshooting,registrationform(seeatt