还剩29页未读,继续阅读
本资源只提供10页预览,全部文档请下载后查看!喜欢就下载吧,查找使用更方便
文本内容:
C语言程序设计课程设计报告设计题目教小学生学英语专业微电子学号3130434063班级班132姓名布玛利亚.吾斯曼指导教师张老师2013年秋季学期~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~I.l\n pr intf\t\t||\n;printf\t\t|记录成功!是否继续记录单词-----------------------------------1\n;printf\t\t||\n;pr intf\t\t||\n;pr intf\t\t|
1.继续|\n;printf\t\t||\n;pr intf\t\t|
1.继续-一\n;pr intf\t\t\n;pr i ntf\t\t
2.退出----\n;pr intf\t\t\n;pr intf\t\t\nn;〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜\n“;pr intf\t\t scanf%d,j;请输入”);ifj==1;else if j==2break;}}zero;se Iect;}vo id see0{int j;printf\t\t\n;printf\t\t\n;printf\t\t||\n;printf\t\t||\n;pr intf\t\t|〜〜〜请选择,己,忆类型〜〜〜1\n;pr intf\t\t||\n;printf|\n;pr intf\t\t|
1.记忆单词|\n;printf\t\t||\n;pr intf\t\t|
2.记忆短语|\n;printf|\n;pr intf\t\t|
3.记忆句子|\n;printf\t\t||\n;pr intf|
4.退出|\n;printfH\t\t||\nH;■/II\\IZ~ZZ~ZZ~ZZZZZZZZZZZ~ZZZZ~~~ZZZ~ZZZZZ~~~ZZZZZZZI.pr mtf\t\t||\n;pr intf\t\t请输入;scanf%dn,j;if j==1seel0;e Ise ifj=2see20;e Ise i f j=3see3;e Ise i fj-4{zero;se Iect;}vo id seel{inti,ml;FILE*fp1,*fi1;if f i1=fopen“c1”r=NULL{printf\t无存储信息\;see;}nf i1=fopenCd-rb;if m1-0{printf\t-----------------------无存储信息\n;see;}freadm1,s izeof int,1,f i1;for i=0;im1;i++{fp1=fopen word_l ist,rb;fseek fp1,i*s izeof struct word_l ist,0;fread word[i],s izeof structword_l ist,1,fp1;pr intf英语%s\n\n中文%s\n,word[i].a1,word[i].b1;f■1ff\ff|I\•fcIose fp1;fcIose fi1;see;}vo id see2{inti,m2;FILE*fp2,*fi2;if fi2二fopen”c2,“r二二NULL{pr intf\t无存储信息\n;see;}f i2=fopen,,c2H,^b;freadm2,s izeof int,1,f i2;if m2=0{printf\t-----------------------无存储信息\n;see0;}for i=0;i〈m2;i++{fp2=fopen phrase_l ist,nrb;fseek fp2,i*s izeof struct phrase_l ist,0;fread phrase[i],s izeof structphrase_l ist,1,fp2;pr intf英语%s\n中文%s\nH,phrase[i].a2,phrase[i].b2;■■f VI\V f、|I\•fcIose fp2;fc Iose f i2;see;vo id see3{inti,m3;FILE*fp3,*fi3;if fi3=fopen”c3,“r二二NULL{printf\t无存储信息\n;see0;}fi3=fopennc3H,nrbn;f readm3,s izeof int,1,f i3;if m3=0{printfn\t无存储信息一\n;see0;}for i=0;im3;i++{fp3=fopensentence_l ist,rb;fseek fp3,i*s izeof structsentence_l ist,0;fread sentence[i],s izeof structsentence_I ist,1,fp3;pr intf英语:%s\n中文%s\nH,sentence[i].a3,sentence[i].b3;pr intT k不不不不不不不林不不不不不不不不不林不不不不不不不不不不不不不不不不不不不不不不不不不不不不不不不不不不不不\n;;}fcIose fp3;fc Iose f i3;see;vo id one0{intml,n,k,i,j=0,t;char a
[10]jgetchar0;FILE*fi1,*fp1;if f i1=fopen c1r=NULL{pr intf\t无学习信息\n;zero;select;}f i1=fopen”c1“,”rb“;fread m1,s izeof int,1,f i1;n=m1;fcIose f i1;if n10{printf\n\t学习单词不够,请录入单词\nn;zero;se Iect;e Isepr intf\t单词练习\n;sranduns ignedt imeNULL;for i=0;i5;i++k=rand0%n+1;fp1=fopen uword_l ist1,rb;fseekfp1,k-1*sizeof structword_l ist,0;fread word[k-1],s izeof structword_l ist,1,fp1;pr intf\n%s翻译为中文,wo为中T].a1;gets a;i fstrcmp a,word[k-1].b1=0{pr intf\n回答正确!!!\n;j++;}e Ise{printf\n回答错误,加油,再试试吧n;pr intf\n%s翻译为中文n,word[k-1].a1;gets a;i fstrcmp a,word[k-1].b1二二0printf\n回答正确!!!\n;}eI se{pr intf\n回答错误,记住下面的正确答案哦!-----------------------------------\n;pr intf正确答案:%s\nu,word[k-1].b1;}}for i=5;i10;i++k=rand0%n+1;fp1=fopenword_l istn,rb;fseek fp1,k-1*s izeof structword_l ist,0;fread word[k-1],s izeof structword_l ist,1,fp1;pr intf%s翻译为英文,word[k7].b1;gets a;i fstrcmpa,word[k-1].a1==0{pr intf\n回答正确!!!\n;++;}e Ise{printf\n回答错误,加油,再试试吧!---------------------------------\n;pr intf\n%s翻译为英文翻wo为英T].b1;gets a;getchar;i fstrcmp a,word[k-1].a1=0pr intf\n回答正确!!!\n;}e Ise{pr intf\n回答错误,记住下面的正确答案哦!-----------------------------------\n;pr intf正确答案%s\n,word[k-1].a1;}fcIose fp1;pr intf\n答对%d题,得分%d\n,J,j*10;if j=i*
0.9printf\t\t\n;printf\t\t||\n;printf\t\t||\n;printf\t\t|!!!恭喜你可以进入下一级!!!|\n;printf|\n;pr intf\t\t|
1.进入下一级|\n;printf\t\t||\n;pr intf|
2.继续单词翻译|\n;printf||\n;printf\t\t|
1.继续|\n;printf\t\t||\n;pr intf|
2.退出|\n;pr intf\t\t||\n;pr intf\t\t||\n;printf\t\t||\n;pr intf\t\t请选择;scanf%d,t;if t-1one;if t==2{zero;se Iect;}}}1vo id two{int m2,n,k,i,j=0,t;char a
[20];getchar0;FILE*fi2,*fp2;i ff i2=fopenc2“,r二二NULL pr intf\n无学习信息\n;zero;se Iect;fi2=fopen,,c2n,nrbn;freadm2,s izeof int,1,fi2;n=m2;fcIose fi2;if n10{pr intf\t短语不够,请录入短语\n;zero;se Iect;}e Isepr intf\t短语练习-----------------------------设计任务题目计算机辅助教学(CAI)软件开发教小学生学英语功能
1.屏幕上随机出现一个汉语单词,英语单词,汉语词组,英语词组或一短句提示小学生给出相应答案,答错了要提示要求重新输入,直到答对为止要统计给分,且累计,够一定分数后可进级,即从单词到词组,从词组到短句同样,也可降级起步阶段可各选30个,软件可扩充,即扩大词库的容量(rand(),#includestdio.h结构体、文件或数组)
2.保存将相关数据写入磁盘文件,便于存、取操作分步实施
1、初步完成总体设计,搭好框架,确定人机对话的界面,确定函数个数;
2、完成最低要求能教单词,并有统计功能,即一次答对的成功率为90%以上后可晋级;
3、进一步要求将词库、当前晋级等级保存在磁盘文件,每次登录时读取要求、用语言实现程序设计;1C、利用结构体进行相关信息处理;
2、系统的各个功能模块要求用函数的形式实现;
3、界面友好(良好的人机交互),程序要有注释4平时成绩验收答辩成绩设计报告成绩总评成绩指导教师、总体设计程序的总体设计
1.思考如何使用合理方法使使用者有效利用软件记住单词,将自己的想法通过程序来实现sranduns ignedt imeNULL;for i=0;i5;i++k=rand%n+1;fp2=fopennphrase_l ist,rb;fseek fp2,k-1*s izeof structphrase_l ist,0;fread phrase[k-1],s izeof structphrase_l ist,1,fp2;pr intf n%s翻译为中文,phrase[k-1].a2;scanf%s,a;i fstrcmp a,phrase[k-1].b2==0pr intf(\n回答正确!!!\n);」++;}e Ise(pr intf C\n回答错误,加油,再试试吧\n;gets a;i fstrcmp a,phrase[k-1].b2=0pr intf(\n回答正确!!!\n);}e Ise{pr intf(\n回答错误,记住下面的正确答案哦!---------------------------\n);pr intf%s翻译为中文”,phrase[k7].a2;pr intf正确答案%s\n,phrase[k-1].b2;}for i=5;i10;i++{k=rand0%n+1;fp2=fopenphrase_l ist,nrb;fseek fp2,k-1*s izeof structphrase_l ist,0;fread phrase[k-1],s izeofstruct phrase_l ist,1,fp2;pr intf%s翻译为英文,phrase[kT].b2;gets a;i fstrcmp a,phrase[k-1].a2==0pr intf\n回答正确!!!\n;++;}e Ise{gets a;i fstrcmp a,phrase[k-1].a2=0pr intf(\n回答正确!!!\n);}e Ise{printf(\n回答错误,记住下面的正确答案哦!-----------------------------W);pr intf%s翻译为英文,phrase[k-1].b2;pr intf正确答案:%s\n,phrase[k-1].a2;}fc Iose fp2;pr intf\n—if j=i*
0.9答对%d题,得分%d\n“,j,j*10;pr intf\t\t\n;z I~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~printf n\t\t|pr intf\t\tscanf n%d,t;if t-1pr intf\t\tthree;不彳、~~~~~~~~~~~~~~~~~pr intf\t\tif t=2pr intf\t\ttwo;!!!恭喜你可以进入下一级!!!printf\t\tif t=3pr intf\t\t
1.进入下一级pr intf\t\tzero0;se Iect;pr intf\t\t
2.继续短语翻译pr intf\t\tpr intf\t\t
3.退else if ji*
0.9j=i*
0.6出pr intf\t\tpr intf\t\tpr intf\t\t\n”;pr intf\t\t.一/..Iz~~zzzz~~~zzz~~~zzz〜〜zzzz~~zzz~~zzzz~~zzzzzzzz l\n;itprintf\t\t|pr intf\t\tl\nn;pr intf\t\t|pr intf n\t\t继续努力pr intf\t\tpr intf\t\tpr intf\t\t
1.继续pr intf\t\tpr intf\t\t
2.退出pr intf\t\tpr intf\t\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~pr intf\t\tpr intf\t\tscanf%d,t;if t==1two;if t==2zero;se Iect;e Isepr intf\t\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~pr intf\t\tpr intf\t\tpr intf\t\t再做一下单词练习吧pr intf\t\tpr intf\t\tpr intf\t\t
1.好的pr intf\t\tpr intf\t\t2,退出pr intf\t\tpr intf\t\tZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZpr intf\t\tpr intf\t\tscanf%d,t;if t-1one;if t=2zero;se Iect;}}vo id three{intm3,n,k,i,j=0,t;char a
[100]jgetchar0;FILE*fi3,*fp3;if fi3=fopen”c3“,“r”=NULL{pr intf无学习信息\n;zero;se Iect;fi3=fopen,,c3n,rb;freadm3,s izeof int,1,fi3;n=m3;fcIose fi3;if n10{pr intf\t句子不够,请录入短语\nn;zero;se Iect;}e Ise{pr intf\t句子练习------------------------------------;sranduns ignedt imeNULL;for i=0;i5;i++k二rand%n+1;fp3=fopensentence_l ist,rb;fseek fp3,k-1*s izeof structsentence_l ist,0;fread sentence[k-1],s izeof structsentence_l ist,1,fp3;pr intf%s翻译为中文,sentence[k-1].a3;scanf%sH,a;i fstrcmp a,sentence[k-1].b3=0pr intf\n回答正确!!!\n;++;}e Ise{pr intf n\n回答错误,加油,再试试吧--------------------------------\十;gets a;i fstrcmp a,sentence[k-1].b3==0pr intf(\n回答正确!!!\n);)e Ise{printf(\n回答错误,记住下面的正确答案哦!-----------------------------\n);pr intf n%s翻译为中文,sentence[k7].a3;pr intf正确答案:%s\n,sentence[k-1],b3;for i=5;i10;i++k=rand%n+1;fp3=fopen sentence」ist,nrb;fseek fp3,k-1*s izeof structsentence_l ist,0;fread sentence[k-1],s izeof structsentence_l ist,1,fp3;pr intf%s翻译为英文二sentence[k7].b3;scanf”%s”,a;i fstrcmp a,sentence[k-1].a3=0pr intf\n回答正确!!!\n;」++;}e Ise{pr intf\n回答错误,加油,再试试吧\;scanf H%s,a;i fstrcmp a,sentence[k-1].a3==0npr intf\n回答正确!!!\n;e Ise{printf\n回答错误,记住下面的正确答案哦!-----------------------------\n;pr intf C%s翻译为英文,sentence[kT].b3;pr intf正确答案:%s\n,sentence[k-1].a3;}}fc Iose fp3;printf答对%d题,得分%d\n“,j,j*10;pr intf\t\tz~~zzz〜〜〜pr intf\t\tzzzzz~zzzz~~zzzz~zzzz~~zzzz~~~pr intf\t\tzzzzzzzpr intf\t\tpr intf\t\tpr intf\t\tpr intf\t\t
1.继续句子翻译pr intf\t\tpr intf\t\t2,退出printf\t\tpr intf\t\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~pr intf\t\tpr intf\t\tscanf%d,t;if t==1three;if t=2zero;se Iect;}else ifji*
0.9j=i*
0.6pr intf\t\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~pr intf\t\tpr intf\t\tpr intfn\t\t…----------~!!!继续努力!!!~~~~pr intf\t\tpr intf\t\tpr intf\t\t
1.继续句子练习pr intf\t\tpr intf\t\t2,退出printf H\t\tpr intf\t\t.0\I〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜I.〜〜〜〜〜〜〜〜〜〜printf\t\t||\n;pr intf\t\t scanfn%d,t;if t==1two;if t=2{zero;se Iect;}}e Isepr intf\t\t\npr intf\t\tpr intf\t\t〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜I\〜〜〜〜〜〜〜〜〜〜npr intf\t\tl\nl\npr intf\t\t--------------建议你再做一下其他练习吧!!!----------|\npr intf\t\tl\n l\npr intf\t\t
1.单词练习|\npr intf\t\tl\npr intf\t\t
2.短语练习|\npr intf\t\tl\npr intf\t\t
3.退出|\n”pr intf\t\t\n”pr intf\t\t\npr intf\t\t\npr intf\t\t请选择;scanf%d,t;if t==1one;if t==2two;if t==3zero;se Iect;}
三、测试及调试测试方案、存在的问题及解决方法I、小结数据结构
2.函数原型声明
3.
二、详细设计流程图
1.main
2.源程序#i ncIudestdi o.h#i ncIudestri ng.h#i ncIudetime.h#i ncIudestdI i b.h#def ine SI ZE100〃声明函数,结构void zero;//主显示界面void select;〃选择界面void save;〃保存界面函数void savel;//保存单词函数void save2;〃保存短语函数附件主要源程序代码void save3;〃保存短句函数void see;//查看词库界面void seel0;〃查看单词词库void see2;〃查看短语词库void see3;〃查看短句词库voidone;//学习单词函数void two;//学习短语函数void three;//学习短句函数structword_l ist{char a1
[10];char b1
[10];}word[SI ZE];structphrase_l ist{char a2
[20];char b2
[20];}phrase[SIZE];structsentence_l ist{char a3
[100];char b3
[100];}sentence[SIZE];〃定义函数vo id main{zeroO;se Iect;vo id zero{pr intf\n;pr intf\n\n\n;pr intf\t|〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜pr intf\t|pr intf\t|pr intfn\t---------快一乐一学一习快一乐一成一l\nn;长pr intf\t I\nn;pr intf\t Iove me,Iove Engl i sh!l\n;pr intf\t\n”;pr intf\t\n;pr intf\t
1.开始学习\n;pr intf\t\n;pr intf\t
2.扩大词库pr intf\t\n;pr intf\t
3.查看词库\n;pr intf\t\n;pr intf\t
4.退出系统\n;pr intf\t\n;pr intf\t\n;pr intf\t\n;pr intf\t\n”\n”;;vo id se Iect{inta;pr intf\t\tscanf n%d,a;switch a{case1:one;break;case2:save;break;case3:see;break;case4:ex it0;default:pr intf error\n;vo id save{int b;pr intf\n;pr intf\n;z zzzzzzz zzzzzzzzzzpr intf\t\t〜〜〜〜〜〜〜〜pr intf\t\t l\nn;pr intf\t\t---------快一乐一学-习一一快-乐一成-长----l\n;pr intf\t\t l\n;pr intf\t\t!!!Ioveme,Iove engIish!!!|\n;l\n;pr intf\t\t
1.记录单词l\n;pr intf\t\tl\n;pr intf\t\t
2.记录词组|\n;printf n\t\tl\n;pr intf\t\t
3.记录句子|\n;pr intf\t\tl\n;pr intf\t\t
4.返回|\n;pr intf\t\tl\nn;pr intf\t\tzzzzz zzzzzzzzzzz〜〜〜〜pr intf\t\tpr intf请输入”;scanf\n%d,b;switchb{case1:savel0;break;case2:save2;break;case3:save3;break;case4:zero;se Iect;break;defau11:pr intf error\n;}vo id savel{int i,j,ml;FILE*fp1,*fi1;if fp1=fopenHword_l ist-r=NULL{fp1=fopen word_l istn,wb;fclosefp1;}i ffi1open c1r=NULL{m1=0;fi1=fopen d,wb;fwr ite m1,s izeof int,1,fi1;fcIose fi1;}iffi1=fopen”c1,“rb!=NULL fi1=fopennc1H,nrbH;freadm1,s izeof int,1,fi1;i=m1;for i;i二SIZE;i++{if m1=SIZE-1{printf\n已存满,不能存入数据11;break;}e Ise{printf请输入英文单词;getchar;gets word[i].a1;pr in\n请输入中文词语;gets word[i].b1;if fp1=fopenHword_l ist,“ab=NULL pr intf cannotopen file\n;exit0;i ffwr ite word[i],s izeof structword_l ist,1,fp1!=1printf fi Iewr ite error\n;fcIose fp1;m1=m1+1;if fi1=fopen“c1”,“wb==NULL printf cannotopen file\n;exit0;}i ffwr ite m1,s izeof int,1,fi1!=1fcIose fi1;printf\t\tpr intf\t\tZ~~ZZZ〜〜〜pr intf\t\tpr intf\t\tpr intf\t\t记录成功!是否继续记录单词printf\t\tpr intf\t\tpr intf\t\t
1.继续-一printf\t\tpr intf\t\t
2.退出-----printf\t\tpr intf\t\t~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~printf\t\tpr intf\t\tpr intf fi Iewrite error\n;scanf%dn,j;ifj==1;else ifj==2break;}zeroO;se Iect;1vo id save2{int i,j,m2;FILE*fp2,*fi2;iffp2=fopen phrase_l ist,r==NULL{fp2=fopenuphrase_l ist,wb;fcIose fp2;}if fi2=fopen c2n,nrn=NULL{m2=0;fi2=fopennc2H,nwbn;fwr item2,s izeof int,1,fi2;fc Iose fi2;}if fi2=fopenHc2H,urbu!=NULL fi2=fopennc2n,Hrbn;f readm2,s izeof int,1,fi2;i=m2;}fori;i=SIZE;i++{if m2=SIZE-1{pr intf\n已存满,不能存入数据11;break;}eIse{pr intf请输入英文短语:;getchar;gets phrase[i].a2;pr intf\n请输入中文短语:;gets phrase[i].b2;if fp2=fopenHphrase_l istn,ab—NULLpr intfcannotopenfile\n;exit0;}iffwrite phrase[i],s izeof structphrase_list,1,fp2!=1printffiIewriteerror\n;fcIose fp2;m2=m2+1;if fi2=fopen”c2“,“wb=NULLpr intfcannotopenfile\n;exit0;iffwr item2,s izeof int,1,fi2!=1pr intffi Iewrite error\n;fc Iose fi2;printf\t\t\n;printf\t\t\n;。