教小学生学英语.docx
- 文档编号:24214639
- 上传时间:2023-05-25
- 格式:DOCX
- 页数:26
- 大小:19.29KB
教小学生学英语.docx
《教小学生学英语.docx》由会员分享,可在线阅读,更多相关《教小学生学英语.docx(26页珍藏版)》请在冰豆网上搜索。
教小学生学英语
#include
#include
#include
#include
#include
structWord/*通用此结构体*/
{charEnglish[50];
charChinese[5][30];
intcount;
};
intsum=0,right=0,flag=0,com=30;/*全局变量*/
floatrate=0;
voidinstruction();
voidword();
voidphrase();
voidsentence();
voidgrade();
voiderror();
voiderror1();
voidinput()/*添加*/
{structWorda[1000],b;
FILE*p;
charch,c;
inti,j,y;
system("cls");
printf("\n");
printf("\n");
printf("\t\t|--------------------------------------------------|\n");
printf("\t\t|---------------------欢迎使用---------------------|\n");
printf("\t\t|__________________________________________________|\n");
printf("\t\t|1.添加单词|\n");
printf("\t\t|__________________________________________________|\n");
printf("\t\t|2.添加短语|\n");
printf("\t\t|__________________________________________________|\n");
printf("\t\t|3.添加句子|\n");
printf("\t\t|__________________________________________________|\n");
printf("\t\t|--------------------------------------------------|\n");
printf("\t\t请选择(1-3):
");
c=getchar();fflush(stdin);
switch(c)
{case'1':
p=fopen("word.txt","ab+");break;
case'2':
p=fopen("parse.txt","ab+");break;
case'3':
p=fopen("sentence.txt","ab+");break;
}
for(i=0;i<1000;i++)
{
j=1;y=1;
printf("英文:
");
gets(a[i].English);
printf("中文%d:
",j);
gets(a[i].Chinese[j-1]);
while(y)
{printf("还有中文意思吗?
(N/Y)--");
ch=getchar();
getchar();
if(ch=='n'||ch=='N')
{a[i].count=j;y=0;}
else
{j++;
printf("中文%d:
",j);
gets(a[i].Chinese[j-1]);
}}
fwrite(&a[i],sizeof(structWord),1,p);
printf("是否继续输入:
(Y/N)--");
ch=getchar();
getchar();
if(ch=='n'||ch=='N')
break;
}fclose(p);
}
voiddisplay()/*显示文件*/
{structWordx;
FILE*f;
inti;
charc;
system("cls");
printf("\n");
printf("\n");
printf("\t\t|--------------------------------------------------|\n");
printf("\t\t|---------------------显示内容---------------------|\n");
printf("\t\t|__________________________________________________|\n");
printf("\t\t|1.显示单词|\n");
printf("\t\t|__________________________________________________|\n");
printf("\t\t|2.显示短语|\n");
printf("\t\t|__________________________________________________|\n");
printf("\t\t|3.显示句子|\n");
printf("\t\t|__________________________________________________|\n");
printf("\t\t|--------------------------------------------------|\n");
printf("\t\t请选择(1-3):
");
c=getchar();fflush(stdin);
switch(c)
{case'1':
f=fopen("word.txt","ab+");break;
case'2':
f=fopen("parse.txt","ab+");break;
case'3':
f=fopen("sentence.txt","ab+");break;
}
while(!
feof(f))
{fread(&x,sizeof(structWord),1,f);
if(!
feof(f))
{printf("英文:
%s\t",x.English);
for(i=0;i printf("中文%d: %s\t",i+1,x.Chinese[i]);} printf("\n"); } fclose(f); } menu2()/*退出答题后界面*/ {charc; system("cls"); while (1) {printf("\n"); printf("\n"); printf("\t\t|--------------------------------------------------|\n"); printf("\t\t|-------------------欢迎使用软件-------------------|\n"); printf("\t\t|__________________________________________________|\n"); printf("\t\t|1.添加|\n"); printf("\t\t|__________________________________________________|\n"); printf("\t\t|2.显示|\n"); printf("\t\t|__________________________________________________|\n"); printf("\t\t|3.退出系统|\n"); printf("\t\t|__________________________________________________|\n"); printf("\t\t|--------------------------------------------------|\n"); printf("\t\t请选择(1-3): "); c=getchar();fflush(stdin); switch(c) {case'1': input();break; case'2': display();break; case'3': exit(0); default: error1(); } } } voidmenu1()/*进入答题界面*/ {system("cls"); intn; printf("\n"); printf("\n"); printf("\t\t|---------------欢迎进入英语学习系统---------------|\n"); printf("\t\t||\n"); printf("\t\t|------------------1.进入使用说明------------------|\n"); printf("\t\t|__________________________________________________|\n"); printf("\t\t||\n"); printf("\t\t|------------------2.进入单词学习------------------|\n"); printf("\t\t|__________________________________________________|\n"); printf("\t\t||\n"); printf("\t\t|------------------3.进入词组学习------------------|\n"); printf("\t\t|__________________________________________________|\n"); printf("\t\t||\n"); printf("\t\t|------------------4.进入短句学习------------------|\n"); printf("\t\t|__________________________________________________|\n"); printf("\t\t||\n"); printf("\t\t|------------------5.进入查看成绩------------------|\n"); printf("\t\t|__________________________________________________|\n"); printf("\t\t||\n"); printf("\t\t|------------------6.退出学习系统------------------|\n"); printf("\t\t|__________________________________________________|\n"); printf("\t请选择序号操作: []\b\b"); scanf("%d",&n); fflush(stdin); switch(n) { case1: instruction();break;/*说明*/ case2: word();break;/*单词训练*/ case3: phrase();break;/*短语训练*/ case4: sentence();break;/*句子训练*/ case5: grade();break;/*成绩*/ case6: menu2(); default: error();/*出错*/ } system("cls"); } voidmenu3() {system("cls"); charc; printf("\n"); printf("\n"); printf("\n"); printf("\n"); printf("\t\t|**************************************************|\n"); printf("\t\t|---------------欢迎使用教小学生学英语-------------|\n"); printf("\t\t||\n"); printf("\t\t|------------------1.进入答题系统------------------|\n"); printf("\t\t|__________________________________________________|\n"); printf("\t\t||\n"); printf("\t\t|------------------2.退出答题系统------------------|\n"); printf("\t\t|**************************************************|\n"); printf("\t请选择序号操作: []\b\b"); c=getchar();fflush(stdin); switch(c) { case'1': menu1();break; case'2': menu2();break; default: error(); } } voidinstruction() { system("cls"); charch; printf("\n"); printf("\n"); printf("\n"); printf("屏幕上随机出现一个汉语单词,英语单词,汉语词组,英语词组或一短句提示小学生给出相应答案,答错了要提示要求重新输入,直到答对为止。 统计给分且累计到十个,准确率为0.6,可进级,即从单词到词组,从词组到短句。 \n"); printf("按任意键返回菜单"); fflush(stdin); ch=getchar(); if(ch! =NULL) { menu1(); } } voidword() {system("cls"); inta=0,b=0,c=0; structWordw,stu; do { FILE*p; if((p=fopen("word.txt","r"))==NULL) {printf("Cannotopenthisfile! "); exit(0);} inti,j,r,n; charx[30],ch; n=0; while(fread(&stu,sizeof(structWord),1,p))n++; srand((unsigned)time(NULL)); /*printf("一共%d单词\n\n",n);*/ i=rand()%n; fseek(p,i*sizeof(structWord),0);/*随机抽取*/ fread(&w.English[0],sizeof(structWord),1,p); if(i%2==0)/*偶数是出英语找出正确中文*/ { printf("%s\t-",w.English); scanf("%s",x); fflush(stdin); for(j=0;j {r=0; if(strcmp(x,w.Chinese[j])==0) {r=1;break;}} if(r) {printf("恭喜您,答对了! \n");right++,a++;}/*两次机会*/ else { printf("对不起,答错了! 您还有一次机会哦! \n"); printf("%s\t",w.English); scanf("%s",x); fflush(stdin); for(j=0;j {r=0; if(strcmp(x,w.Chinese[j])==0) {r=1;break;}} if(r) {printf("恭喜您,已经答对了! ");right++,a++;} else {printf("对不起您已经两次回答错误");} } } else/*奇数是出中文拼写英语*/ { printf("%s\t-",w.Chinese[0]); scanf("%s",x); fflush(stdin); if(strcmp(x,w.English)==0) {printf("恭喜您,答对了! \n");right++,a++;} else { printf("对不起,答错了! 您还有一次机会哦! \n"); printf("%s\t-",w.Chinese); scanf("%s",x); fflush(stdin); if(strcmp(x,w.English)==0) {printf("恭喜您,已经答对了! ");right++,a++;/*正确个数*/} else {printf("对不起您已经两次回答错误");;} } } sum++,b++;/*共回答的英语总数*/ if(b==3) { if(c=(float)a/(float)b>=0.6) {printf("\n\n恭喜你已经基本单词练习,是否要继续学习(Y/N): "); fflush(stdin); ch=getchar(); getchar(); if(ch=='Y'||ch=='y') phrase(); elsea=0,b=0,c=0; }} printf("继续学习这一关(Y/y)? 按任意键返回菜单? \n"); fflush(stdin); ch=getchar(); if(ch=='Y'||ch=='y') flag=1; else { flag=0; system("cls"); menu1(); } }while(flag); } voidphrase()/*同上*/ {inta=0,b=0; floatc=0; system("cls"); structWordpar,stu; do { FILE*p; if((p=fopen("parse.txt","r"))==NULL) {printf("Cannotopenthisfile! "); exit(0);} inti,j,r,n; charx[30],ch; n=0; while(fread(&stu,sizeof(structWord),1,p))n++; /*printf("一共%d短语\n\n",n);*/ srand((unsigned)time(NULL)); i=rand()%n; fseek(p,i*sizeof(structWord),0); fread(&par,sizeof(structWord),1,p); if(i%2==0) { printf("%s\t-",par.English); gets(x); fflush(stdin); for(j=0;j {r=0; if(strcmp(x,par.Chinese[j])==0) {r=1;break;}} if(r) {printf("恭喜您,答对了! \n");right++,a++;} else { printf("对不起,答错了! 您还有一次机会哦! \n"); printf("%s\t",par.English); gets(x); fflush(stdin); for(j=0;j {r=0; if(strcmp(x,par.Chinese[j])==0) {r=1;break;}} if(r) {printf("恭喜您,已经答对了! ");right++,a++;} else {printf("对不起您已经两次回答错误");} } } else { printf("%s\t-",par.Chinese[0]); gets(x); fflush(stdin); if(strcmp(x,par.English)==0) {printf("恭喜您,答对了! \n");right++,a++;} else { printf("对不起,答错了! 您还有一次机会哦! \n"); printf("%s\t-",par.Chinese[0]); gets(x); fflush(stdin); if(strcmp(x,par.English)==0) {printf("恭喜您,已经答对了! ");right++,a++;} else {printf("对不起您已经两次回答错误");;} } } sum++,b++; if(b==3) { if(c=(float)a/(float)b>=0.6) {printf("\n\n恭喜你已经基本短语练习,是否要继续学习(Y/N): "); fflush(stdin); ch=getchar(); getchar(); if(ch=='Y'||ch=='y') sentence(); elsea=0,b=0,c=0; }} printf("继续学习这一关(Y/y)? 按任意键返回菜单? \n"); fflush(stdin); ch=getchar(); sentence(); if(ch=='Y'||ch=='y') flag=1; else { flag=0; system("cls"); } }while(flag); menu1(); } voidsentence() {system("cls"); structWordsen,stu; do { FILE*p; if((p=fopen("sentence.txt","r"))==NULL) {printf("Cannotopenthisfile! "); exit(0);} inti,j,r,n; charx[30],ch; n=0; while(fread(&stu,sizeof(structWord),1,p))n++; /*printf("一共%d句子\n\n",n);*/ srand((unsigned)time(NULL)); i=rand()%com; fseek(p,i*sizeof(structWord),0); fread(&sen,sizeof(structWord),1,p); if(i%2==0) { printf("%s\t-",sen.English);
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 小学生 英语